Skip to content
Permalink
Browse files

Merge branch 'master' into selectmenu

  • Loading branch information
fnagel committed Oct 21, 2013
2 parents 7af3dab + fdc7052 commit fab6b8883e9464d101e2550dd2c12706a9de164d
@@ -20,7 +20,7 @@
$( "#draggable" ).draggable({ snap: true });
$( "#draggable2" ).draggable({ snap: ".ui-widget-header" });
$( "#draggable3" ).draggable({ snap: ".ui-widget-header", snapMode: "outer" });
$( "#draggable4" ).draggable({ grid: [ 20,20 ] });
$( "#draggable4" ).draggable({ grid: [ 20, 20 ] });
$( "#draggable5" ).draggable({ grid: [ 80, 80 ] });
});
</script>
@@ -257,6 +257,15 @@ test( "ARIA", function() {
"Live region for multiple values" );
});

test( "ARIA, init on detached input", function() {
expect( 1 );
var element = $( "<input>" ).autocomplete({
source: [ "java", "javascript" ]
}),
liveRegion = element.autocomplete( "instance" ).liveRegion;
equal( liveRegion.parent().length, 1, "liveRegion must have a parent" );
});

test( ".replaceWith() (#9172)", function() {
expect( 1 );

@@ -46,10 +46,11 @@ <h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">
<div id="main"></div>
<div id="draggable1" style="background: green; width: 200px; height: 100px;">Relative</div>
<div id="draggable2" style="background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;"><span><em>Absolute</em></span></div>
<div id="droppable" style="background: green; width: 200px; height: 100px; position: absolute; top: 110px; left: 110px;"><span>Absolute</span></div>
<div id="main">
<div id="draggable1" style="background: green; width: 200px; height: 100px;">Relative</div>
<div id="draggable2" style="background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;"><span><em>Absolute</em></span></div>
<div id="droppable" style="background: green; width: 200px; height: 100px; position: absolute; top: 110px; left: 110px;"><span>Absolute</span></div>
</div>
<div style="width: 1px; height: 1000px;"></div>
<div style="position: absolute; width: 1px; height: 2000px;"></div>
</div>
@@ -43,13 +43,13 @@ test( "element types", function() {
});

test( "No options, relative", function() {
expect( 1 );
TestHelpers.draggable.shouldMove( $( "#draggable1" ).draggable() );
expect( 2 );
TestHelpers.draggable.shouldMove( $( "#draggable1" ).draggable(), "no options, relative" );
});

test( "No options, absolute", function() {
expect( 1 );
TestHelpers.draggable.shouldMove( $( "#draggable2" ).draggable() );
expect( 2 );
TestHelpers.draggable.shouldMove( $( "#draggable2" ).draggable(), "no options, absolute" );
});

test( "resizable handle with complex markup (#8756 / #8757)", function() {
@@ -118,14 +118,11 @@ test( "#6258: not following mouse when scrolled and using overflow-y: scroll", f
.scrollLeft( 0 );
}
}),
contentToForceScroll = $( "<div>" ).css({
height: "10000px",
width: "10000px"
}),
oldOverflowY = $( "html" ).css( "overflow-y" ),
oldOverflowX = $( "html" ).css( "overflow-x" );

contentToForceScroll.appendTo( "#qunit-fixture" );
TestHelpers.forceScrollableWindow();

$( "html" )
.css( "overflow-y", "scroll" )
.css( "overflow-x", "scroll" )
@@ -148,13 +145,10 @@ test( "#9315: Draggable: jumps down with offset of scrollbar", function() {
equal( ui.position.top, 11, "top position is correct when position is absolute" );
$( "html" ).scrollTop( 0 ).scrollLeft( 0 );
}
}),
contentToForceScroll = $( "<div>" ).css({
height: "10000px",
width: "10000px"
});

contentToForceScroll.appendTo( "#qunit-fixture" );
TestHelpers.forceScrollableWindow();

$( "html" ).scrollTop( 300 ).scrollLeft( 300 );

element.simulate( "drag", {
@@ -178,13 +172,11 @@ test( "#5009: scroll not working with parent's position fixed", function() {
equal( ui.position.top, 10, "top position is correct when parent position is fixed" );
$( document ).scrollTop( 0 ).scrollLeft( 0 );
}
}),
contentToForceScroll = $( "<div>" ).css({
height: "20000px",
width: "20000px"
});

$( "#qunit-fixture" ).append( contentToForceScroll );

TestHelpers.forceScrollableWindow();

$( "#wrapper" ).css( "position", "fixed" );

element.simulate( "drag", {
@@ -195,7 +187,7 @@ test( "#5009: scroll not working with parent's position fixed", function() {
});

test( "#5727: draggable from iframe" , function() {
expect( 2 );
expect( 1 );

var iframe = $( "<iframe id='iframe-draggable-container' src='about:blank'></iframe>" ).appendTo( "#qunit-fixture" ),
iframeBody = iframe.contents().find( "body" ).append(
@@ -207,7 +199,9 @@ test( "#5727: draggable from iframe" , function() {

equal( draggable1.closest( iframeBody ).length, 1 );

TestHelpers.draggable.shouldMove( draggable1 );
// TODO: fix draggable within an IFRAME to fire events on the element properly
// and these TestHelpers.draggable.shouldMove relies on events for testing
//TestHelpers.draggable.shouldMove( draggable1, "draggable from an iframe" );
});

test( "#8399: A draggable should become the active element after you are finished interacting with it, but not before.", function() {
@@ -54,15 +54,15 @@ test( "enable", function() {
expect( 7 );

element.draggable({ disabled: true });
TestHelpers.draggable.shouldNotMove( element, ".draggable({ disabled: true })" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable({ disabled: true })" );

element.draggable("enable");
TestHelpers.draggable.shouldMove( element, ".draggable('enable')" );
equal( element.draggable( "option", "disabled" ), false, "disabled option getter" );

element.draggable("destroy");
element.draggable({ disabled: true });
TestHelpers.draggable.shouldNotMove( element, ".draggable({ disabled: true })" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable({ disabled: true })" );

element.draggable( "option", "disabled", false );
equal(element.draggable( "option", "disabled" ), false, "disabled option setter" );
@@ -80,7 +80,7 @@ test( "disable", function() {
TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );

element.draggable( "disable" );
TestHelpers.draggable.shouldNotMove( element, ".draggable('disable')" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable('disable')" );
equal( element.draggable( "option", "disabled" ), true, "disabled option getter" );

element.draggable( "destroy" );
@@ -89,7 +89,7 @@ test( "disable", function() {

element.draggable( "option", "disabled", true );
equal( element.draggable( "option", "disabled" ), true, "disabled option setter" );
TestHelpers.draggable.shouldNotMove( element, ".draggable('option', 'disabled', true)" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable('option', 'disabled', true)" );

ok( !element.draggable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
ok( !element.draggable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );

0 comments on commit fab6b88

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