diff options
author | Scott González <scott.gonzalez@gmail.com> | 2013-02-03 08:55:34 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2013-02-03 08:55:34 -0500 |
commit | a7353e7c9ba18e017813195c885115338800e13d (patch) | |
tree | 03136f58389e7e6db7d29cb7c90db96b2e541e5e /ui/jquery.ui.dialog.js | |
parent | 8724092e5070125e2610e8b0e6ee9ada126cf504 (diff) | |
download | jquery-ui-a7353e7c9ba18e017813195c885115338800e13d.tar.gz jquery-ui-a7353e7c9ba18e017813195c885115338800e13d.zip |
Dailog: Cover iframes during drag and resize. Fixes #7650 - Dialog cannot be dragged properly with IFRAME.
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-rw-r--r-- | ui/jquery.ui.dialog.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index f2bc906fd..85dbddda2 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -444,6 +444,7 @@ $.widget( "ui.dialog", { containment: "document", start: function( event, ui ) { $( this ).addClass("ui-dialog-dragging"); + that._blockFrames(); that._trigger( "dragStart", event, filteredUi( ui ) ); }, drag: function( event, ui ) { @@ -455,6 +456,7 @@ $.widget( "ui.dialog", { ui.position.top - that.document.scrollTop() ]; $( this ).removeClass("ui-dialog-dragging"); + that._unblockFrames(); that._trigger( "dragStop", event, filteredUi( ui ) ); } }); @@ -491,6 +493,7 @@ $.widget( "ui.dialog", { handles: resizeHandles, start: function( event, ui ) { $( this ).addClass("ui-dialog-resizing"); + that._blockFrames(); that._trigger( "resizeStart", event, filteredUi( ui ) ); }, resize: function( event, ui ) { @@ -500,6 +503,7 @@ $.widget( "ui.dialog", { options.height = $( this ).height(); options.width = $( this ).width(); $( this ).removeClass("ui-dialog-resizing"); + that._unblockFrames(); that._trigger( "resizeStop", event, filteredUi( ui ) ); } }) @@ -666,6 +670,28 @@ $.widget( "ui.dialog", { } }, + _blockFrames: function() { + this.iframeBlocks = this.document.find( "iframe" ).map(function() { + var iframe = $( this ); + + return $( "<div>" ) + .css({ + position: "absolute", + width: iframe.outerWidth(), + height: iframe.outerHeight() + }) + .appendTo( iframe.parent() ) + .offset( iframe.offset() )[0]; + }); + }, + + _unblockFrames: function() { + if ( this.iframeBlocks ) { + this.iframeBlocks.remove(); + delete this.iframeBlocks; + } + }, + _createOverlay: function() { if ( !this.options.modal ) { return; |