X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/8dab5054c8fd93cbb2c3067fe48a5efff0c75867..456187c9000834d77372cf03f7a63c7bb4d9da49:/project/static/js/jquery.resizable.js?ds=inline diff --git a/project/static/js/jquery.resizable.js b/project/static/js/jquery.resizable.js index 44111ee9..3fae2bf0 100644 --- a/project/static/js/jquery.resizable.js +++ b/project/static/js/jquery.resizable.js @@ -18,7 +18,7 @@ } }; - $.fn.resizable = function(handle, options) { + $.fn.resizable = function(options) { var settings = { minWidth: 0, maxWidth: $(window).width() @@ -27,18 +27,28 @@ $.extend(settings, options); var element = $(this); + var handle = $('.panel-slider', element) - $(handle, element).mousedown(function(event) { + handle.mousedown(function(event) { var position = element.position(); - $.resizable.settings = settings; - $.resizable.element = { + console.log('Mouse down on position: ' + position); + /* from this point on, the panel should resize events */ + + /* $.resizable.settings = settings; + $.resizable.data = { element: element, width: parseInt(element.css('width')) || element[0].scrollWidth || 0, mouseX: event.pageX, - }; - $(document).mousemove($.resizable.drag).mouseup($.resizable.stop); - $('body').css('cursor', 'col-resize'); - }).bind('dragstart', function(event) { event.preventDefault() }); + }; */ + + $(document).mousemove($.resizable.ondrag, element).mouseup($.resizable.stop, element); + /* $('body').css('cursor', 'col-resize'); */ + }); + + /* stop drag events */ + handle.bind('dragstart', function(event) { event.preventDefault(); }) + .bind('drag', function(event) { event.preventDefault(); }) + .bind('draggesture', function(event) { event.preventDefault(); }); }; })(jQuery);