Skip to content
Permalink
Browse files

Draggable Unit Tests: Ensure IFRAMEs can be written to

Draggable tests were failing in IE because the frame needs to be
written to to be accessible to further DOM manipulation.
  • Loading branch information
mikesherov committed Dec 14, 2013
1 parent ec5f395 commit f4839f73a7057a21ea0506d903c4473575aed4a2
Showing with 9 additions and 5 deletions.
  1. +9 −5 tests/unit/draggable/draggable_core.js
@@ -224,11 +224,15 @@ test( "#9379: Draggable: position bug in scrollable div", function() {
test( "#5727: draggable from iframe" , function() {
expect( 1 );

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" );
var iframeBody, draggable1,
iframe = $( "<iframe />" ).appendTo( "#qunit-fixture" ),
iframeDoc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;

iframeDoc.write( "<!doctype html><html><body>" );
iframeDoc.close();

iframeBody = $( iframeDoc.body ).append( "<div style='width: 2px; height: 2px;' />" );
draggable1 = iframeBody.find( "div" );

draggable1.draggable();

0 comments on commit f4839f7

Please sign in to comment.
You can’t perform that action at this time.