aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBrian Grinstead <briangrinstead@gmail.com>2010-06-14 08:20:03 -0700
committerMike Sherov <mike.sherov@gmail.com>2013-05-20 22:10:04 -0400
commit24756a978a977d7abbef5e5bce403837a01d964f (patch)
tree59b473b02fc600d054a3b47ade5b0819f701bd76 /tests
parent433ef9d433e9baa464cd0b313b82efa6f1d65556 (diff)
downloadjquery-ui-24756a978a977d7abbef5e5bce403837a01d964f.tar.gz
jquery-ui-24756a978a977d7abbef5e5bce403837a01d964f.zip
Draggable: enabled draggable from within iframe. Fixed #5727 - draggable: cannot drag element inside iframe
Diffstat (limited to 'tests')
-rw-r--r--tests/jquery.simulate.js2
-rw-r--r--tests/unit/draggable/draggable_core.js16
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js
index 0a0c42487..1dd96ac3a 100644
--- a/tests/jquery.simulate.js
+++ b/tests/jquery.simulate.js
@@ -313,7 +313,7 @@ $.extend( $.simulate.prototype, {
clientY: Math.round( y )
};
- this.simulateEvent( document, "mousemove", coord );
+ this.simulateEvent( target.ownerDocument, "mousemove", coord );
}
if ( $.contains( document, target ) ) {
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js
index e7fcdfa87..e2dc2a481 100644
--- a/tests/unit/draggable/draggable_core.js
+++ b/tests/unit/draggable/draggable_core.js
@@ -169,4 +169,20 @@ test( "#5009: scroll not working with parent's position fixed", function() {
});
});
+test( "#5727: draggable from iframe" , function() {
+ expect( 2 );
+
+ var iframe = $( "<iframe id='iframe-draggable-container' src='about:blank'></iframe>" ).appendTo( "#qunit-fixture" ),
+ iframeBody = iframe.contents().find( "body" ).append(
+ "<div id='iframe-draggable-1' style='background: green; width: 200px; height: 100px;'>Relative</div>"
+ ),
+ draggable1 = iframeBody.find( "#iframe-draggable-1" );
+
+ draggable1.draggable();
+
+ equal( draggable1.closest( iframeBody ).length, 1 );
+
+ TestHelpers.draggable.shouldMove( draggable1 );
+});
+
})( jQuery );