aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.draggable.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-02 14:49:05 -0700
committerScott González <scott.gonzalez@gmail.com>2011-05-02 14:49:05 -0700
commit3d5d58d85437ae11688c0407200fd36bed7c9426 (patch)
tree9e0374d59ce1130c8b039651c1cffa0063b2fe62 /ui/jquery.ui.draggable.js
parent4f63e5ca6c3e1194f89484c43e98913ce4efa1e4 (diff)
parentb1c8a13a1669dca4c4bde97fe2cc8b76f661b432 (diff)
downloadjquery-ui-3d5d58d85437ae11688c0407200fd36bed7c9426.tar.gz
jquery-ui-3d5d58d85437ae11688c0407200fd36bed7c9426.zip
Merge pull request #187 from virgofx/master.
Fix #7270 - Draggable iFrameFix
Diffstat (limited to 'ui/jquery.ui.draggable.js')
-rw-r--r--ui/jquery.ui.draggable.js38
1 files changed, 20 insertions, 18 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index ed49c9d19..774ea4380 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;