Skip to content

Commit

Permalink
Fixed #3842
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardolundgren committed Jan 16, 2009
1 parent 9d3b03d commit 0065499
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions ui/ui.resizable.js
Expand Up @@ -602,14 +602,21 @@ $.ui.plugin.add("resizable", "alsoResize", {

_alsoResize = function(exp, c) {
$(exp).each(function() {
var start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];

$.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
var sum = (start[prop]||0) + (delta[prop]||0);
if (sum && sum >= 0)
style[prop] = sum || null;
});
$(this).css(style);

//Opera fixing relative position
if (/relative/.test(el.css('position')) && $.browser.opera) {
self._revertToRelativePosition = true;
el.css({ position: 'absolute', top: 'auto', left: 'auto' });
}

el.css(style);
});
};

Expand All @@ -621,6 +628,14 @@ $.ui.plugin.add("resizable", "alsoResize", {
},

stop: function(event, ui){
var self = $(this).data("resizable");

//Opera fixing relative position
if (self._revertToRelativePosition && $.browser.opera) {
self._revertToRelativePosition = false;
el.css({ position: 'relative' });
}

$(this).removeData("resizable-alsoresize-start");
}
});
Expand Down

0 comments on commit 0065499

Please sign in to comment.