From: zuber Date: Thu, 20 Aug 2009 13:57:53 +0000 (+0200) Subject: Dodanie biblioteki jquery.resizable.js pozwalającej na zmianę wielkości paska boczneg... X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/82d463191442b0931e0c51c0cf4c2ef1383b400b?ds=inline;hp=--cc Dodanie biblioteki jquery.resizable.js pozwalającej na zmianę wielkości paska bocznego. Wydaje się to jednak bez sensu. --- 82d463191442b0931e0c51c0cf4c2ef1383b400b diff --git a/project/static/css/master.css b/project/static/css/master.css index 03bcd210..c31c4fee 100644 --- a/project/static/css/master.css +++ b/project/static/css/master.css @@ -75,7 +75,7 @@ label { } #images-wrap { - width: 0px; +/* width: 0px;*/ height: 480px; border-right: 1px solid #999; overflow-y: scroll; @@ -99,7 +99,7 @@ label { #toggle-sidebar:hover { background-color: #999; - cursor: pointer; + cursor: ew-resize; } #status-bar { diff --git a/project/static/js/jquery.resizable.js b/project/static/js/jquery.resizable.js new file mode 100644 index 00000000..415aa2da --- /dev/null +++ b/project/static/js/jquery.resizable.js @@ -0,0 +1,31 @@ +(function($){ + $.resizable = { + element: {}, + drag: function(event) { + $.resizable.element.element.css({ + width: Math.max(event.pageX - $.resizable.element.mouseX + $.resizable.element.width, 0) + }) + $.resizable.element.element.trigger('resizable:resize'); + return false; + }, + stop: function() { + $.resizable.element.element.trigger('resizable:stop'); + $().unbind('mousemove', $.resizable.drag).unbind('mouseup', $.resizable.stop); + return false; + } + }; + + $.fn.resizable = function(handle) { + var element = $(this); + $(handle, element).mousedown(function(event) { + var position = element.position(); + $.resizable.element = { + element: element, + width: parseInt(element.css('width')) || element[0].scrollWidth || 0, + mouseX: event.pageX, + }; + $().mousemove($.resizable.drag).mouseup($.resizable.stop); + }); + }; +})(jQuery); + diff --git a/project/templates/explorer/file_xml.html b/project/templates/explorer/file_xml.html index 314c08e3..b78e3dee 100644 --- a/project/templates/explorer/file_xml.html +++ b/project/templates/explorer/file_xml.html @@ -7,11 +7,12 @@ +