fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Powinno działać nawet przy braku ustawień.
[redakcja.git]
/
project
/
static
/
js
/
jquery.resizable.js
diff --git
a/project/static/js/jquery.resizable.js
b/project/static/js/jquery.resizable.js
index
415aa2d
..
44111ee
100644
(file)
--- a/
project/static/js/jquery.resizable.js
+++ b/
project/static/js/jquery.resizable.js
@@
-1,31
+1,44
@@
(function($){
$.resizable = {
(function($){
$.resizable = {
+ settings: {},
element: {},
drag: function(event) {
$.resizable.element.element.css({
element: {},
drag: function(event) {
$.resizable.element.element.css({
- width: Math.max(event.pageX - $.resizable.element.mouseX + $.resizable.element.width, 0)
+ width: Math.max(event.pageX - $.resizable.element.mouseX + $.resizable.element.width,
+ $.resizable.settings.minWidth)
})
$.resizable.element.element.trigger('resizable:resize');
return false;
},
})
$.resizable.element.element.trigger('resizable:resize');
return false;
},
- stop: function() {
+ stop: function(
event
) {
$.resizable.element.element.trigger('resizable:stop');
$.resizable.element.element.trigger('resizable:stop');
- $().unbind('mousemove', $.resizable.drag).unbind('mouseup', $.resizable.stop);
+ $(document).unbind('mousemove', $.resizable.drag).unbind('mouseup', $.resizable.stop)
+ $('body').css('cursor', 'auto');
return false;
}
};
return false;
}
};
- $.fn.resizable = function(handle) {
+ $.fn.resizable = function(handle, options) {
+ var settings = {
+ minWidth: 0,
+ maxWidth: $(window).width()
+ }
+
+ $.extend(settings, options);
+
var element = $(this);
var element = $(this);
+
$(handle, element).mousedown(function(event) {
var position = element.position();
$(handle, element).mousedown(function(event) {
var position = element.position();
+ $.resizable.settings = settings;
$.resizable.element = {
element: element,
width: parseInt(element.css('width')) || element[0].scrollWidth || 0,
mouseX: event.pageX,
};
$.resizable.element = {
element: element,
width: parseInt(element.css('width')) || element[0].scrollWidth || 0,
mouseX: event.pageX,
};
- $().mousemove($.resizable.drag).mouseup($.resizable.stop);
- });
+ $(document).mousemove($.resizable.drag).mouseup($.resizable.stop);
+ $('body').css('cursor', 'col-resize');
+ }).bind('dragstart', function(event) { event.preventDefault() });
};
})(jQuery);
};
})(jQuery);