X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/08eafa7ea0680c755be43561ba599c7ebf3b0fff..fa300c83de0c9788beb4e833c2003618e7d20646:/project/static/js/jquery.resizable.js?ds=sidebyside diff --git a/project/static/js/jquery.resizable.js b/project/static/js/jquery.resizable.js index fafddc9e..3fae2bf0 100644 --- a/project/static/js/jquery.resizable.js +++ b/project/static/js/jquery.resizable.js @@ -13,12 +13,12 @@ stop: function(event) { $.resizable.element.element.trigger('resizable:stop'); $(document).unbind('mousemove', $.resizable.drag).unbind('mouseup', $.resizable.stop) - .children('body').css({cursor: 'auto'}) + $('body').css('cursor', 'auto'); return false; } }; - $.fn.resizable = function(handle, options) { + $.fn.resizable = function(options) { var settings = { minWidth: 0, maxWidth: $(window).width() @@ -27,19 +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) - .children('body').css({cursor: 'se-resize'}); - event.stopImmediatePropagation(); - }).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);