From 82d463191442b0931e0c51c0cf4c2ef1383b400b Mon Sep 17 00:00:00 2001 From: zuber Date: Thu, 20 Aug 2009 15:57:53 +0200 Subject: [PATCH] =?utf8?q?Dodanie=20biblioteki=20jquery.resizable.js=20poz?= =?utf8?q?walaj=C4=85cej=20na=20zmian=C4=99=20wielko=C5=9Bci=20paska=20boc?= =?utf8?q?znego.=20Wydaje=20si=C4=99=20to=20jednak=20bez=20sensu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- project/static/css/master.css | 4 +-- project/static/js/jquery.resizable.js | 31 ++++++++++++++++++++++++ project/templates/explorer/file_xml.html | 6 ++++- 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 project/static/js/jquery.resizable.js 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 @@ +