Skip to content

Commit 930c650

Browse files
committed
Draggable: Only run iframeFix logic if the option is truthy. Fixes #7632 - Draggable: iframeFix always runs with old versions of jQuery.
1 parent 7c15d3c commit 930c650

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

ui/jquery.ui.draggable.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,17 @@ $.widget("ui.draggable", $.ui.mouse, {
8080
if (!this.handle)
8181
return false;
8282

83-
$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
84-
$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
85-
.css({
86-
width: this.offsetWidth+"px", height: this.offsetHeight+"px",
87-
position: "absolute", opacity: "0.001", zIndex: 1000
88-
})
89-
.css($(this).offset())
90-
.appendTo("body");
91-
});
83+
if ( o.iframeFix ) {
84+
$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
85+
$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
86+
.css({
87+
width: this.offsetWidth+"px", height: this.offsetHeight+"px",
88+
position: "absolute", opacity: "0.001", zIndex: 1000
89+
})
90+
.css($(this).offset())
91+
.appendTo("body");
92+
});
93+
}
9294

9395
return true;
9496

0 commit comments

Comments
 (0)