Skip to content

Commit 0065499

Browse files
Fixed #3842
1 parent 9d3b03d commit 0065499

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

ui/ui.resizable.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,21 @@ $.ui.plugin.add("resizable", "alsoResize", {
602602

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

607607
$.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
608608
var sum = (start[prop]||0) + (delta[prop]||0);
609609
if (sum && sum >= 0)
610610
style[prop] = sum || null;
611611
});
612-
$(this).css(style);
612+
613+
//Opera fixing relative position
614+
if (/relative/.test(el.css('position')) && $.browser.opera) {
615+
self._revertToRelativePosition = true;
616+
el.css({ position: 'absolute', top: 'auto', left: 'auto' });
617+
}
618+
619+
el.css(style);
613620
});
614621
};
615622

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

623630
stop: function(event, ui){
631+
var self = $(this).data("resizable");
632+
633+
//Opera fixing relative position
634+
if (self._revertToRelativePosition && $.browser.opera) {
635+
self._revertToRelativePosition = false;
636+
el.css({ position: 'relative' });
637+
}
638+
624639
$(this).removeData("resizable-alsoresize-start");
625640
}
626641
});

0 commit comments

Comments
 (0)