r2375 - merged to /branches/1.6, trunk r1838 - resizable: containment option, container size chan...
Author: scott.gonzalez
Date: Tue Mar 24 17:30:30 2009
New Revision: 2375
Modified:
branches/1.6/ui/ui.resizable.js
Log:
merged to /branches/1.6, trunk r1838 - resizable: containment option,
container size changes during resize in IE6 - Fixed #3954
Modified: branches/1.6/ui/ui.resizable.js
==============================================================================
--- branches/1.6/ui/ui.resizable.js (original)
+++ branches/1.6/ui/ui.resizable.js Tue Mar 24 17:30:30 2009
@@ -260,7 +260,7 @@
_mouseStart: function(event) {
var o = this.options, iniPos = this.element.position(), el =
this.element,
- num = function(v) { return parseInt(v, 10) || 0; }, ie6 =
$.browser.msie && $.browser.version < 7;
+ ie6 = $.browser.msie && $.browser.version < 7;
o.resizing = true;
o.documentScroll = { top: $(document).scrollTop(), left:
$(document).scrollLeft() };
@@ -348,7 +348,7 @@
_mouseStop: function(event) {
this.options.resizing = false;
- var o = this.options, num = function(v) { return parseInt(v, 10) || 0;
}, self = this;
+ var o = this.options, self = this;
if(o.helper) {
var pr = o.proportionallyResize, ista = pr &&
(/textarea/i).test(pr.get(0).nodeName),
@@ -678,9 +678,12 @@
// i'm a node, so compute top, left, right, bottom
else{
- self.containerOffset = $(ce).offset();
- self.containerPosition = $(ce).position();
- self.containerSize = { height: $(ce).innerHeight(), width:
$(ce).innerWidth() };
+ var element = $(ce), p = [];
+ $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] =
num(element.css("padding" + name)); });
+
+ self.containerOffset = element.offset();
+ self.containerPosition = element.position();
+ self.containerSize = { height: (element.innerHeight() - p[3]), width:
(element.innerWidth() - p[1]) };
var co = self.containerOffset, ch = self.containerSize.height, cw =
self.containerSize.width,
width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height
= ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
@@ -800,5 +803,9 @@
}
});
+
+var num = function(v) {
+ return parseInt(v, 10) || 0;
+};
})(jQuery);