diff options
author | Mark Johnson <virgofx@live.com> | 2011-04-19 14:39:58 -0700 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-02 17:49:38 -0400 |
commit | 15b9e9d176a7796f1582ba5c0a7d06e4ad7cc8e9 (patch) | |
tree | f33f09807318df32704e8d5413d86756ed49fdea | |
parent | f3737a91835f6b35b49a5b821e7cc555340c6057 (diff) | |
download | jquery-ui-15b9e9d176a7796f1582ba5c0a7d06e4ad7cc8e9.tar.gz jquery-ui-15b9e9d176a7796f1582ba5c0a7d06e4ad7cc8e9.zip |
Draggable: Modified the iframe shims to load prior to dragging. Fixed #7270.
(cherry picked from commit b1c8a13a1669dca4c4bde97fe2cc8b76f661b432)
-rw-r--r-- | ui/jquery.ui.draggable.js | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 8958e49cf..cf08e4798 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -79,6 +79,16 @@ $.widget("ui.draggable", $.ui.mouse, { this.handle = this._getHandle(event); if (!this.handle) return false; + + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); return true; @@ -212,6 +222,16 @@ $.widget("ui.draggable", $.ui.mouse, { return false; }, + _mouseUp: function(event) { + if (this.options.iframeFix === true) { + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); //Remove frame helpers + } + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + cancel: function() { if(this.helper.is(".ui-draggable-dragging")) { @@ -630,24 +650,6 @@ $.ui.plugin.add("draggable", "cursor", { } }); -$.ui.plugin.add("draggable", "iframeFix", { - start: function(event, ui) { - var o = $(this).data('draggable').options; - $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { - $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') - .css({ - width: this.offsetWidth+"px", height: this.offsetHeight+"px", - position: "absolute", opacity: "0.001", zIndex: 1000 - }) - .css($(this).offset()) - .appendTo("body"); - }); - }, - stop: function(event, ui) { - $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers - } -}); - $.ui.plugin.add("draggable", "opacity", { start: function(event, ui) { var t = $(ui.helper), o = $(this).data('draggable').options; |