<meta charset="utf-8">
<title>jQuery UI Sortable Test Suite</title>
- <script src="../../jquery.js"></script>
- <link rel="stylesheet" href="../../../external/qunit/qunit.css">
- <script src="../../../external/qunit/qunit.js"></script>
- <script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
- <script src="../testsuite.js"></script>
- <script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
- <script>
- TestHelpers.loadResources({
- css: [ "core" ],
- js: [
- "ui/core.js",
- "ui/widget.js",
- "ui/mouse.js",
- "ui/sortable.js",
- "ui/draggable.js"
- ]
- });
- </script>
-
- <script src="sortable_common.js"></script>
- <script src="sortable_core.js"></script>
- <script src="sortable_events.js"></script>
- <script src="sortable_methods.js"></script>
- <script src="sortable_options.js"></script>
- <script src="sortable_test_helpers.js"></script>
-
- <script src="../swarminject.js"></script>
+ <script src="../../lib/css.js" data-modules="core"></script>
+ <script src="../../lib/bootstrap.js" data-widget="sortable"></script>
<style>
#sortable, #sortable2 {
position:relative;
-/*
- * sortable_core.js
- */
-
-(function( $ ) {
+define( [
+ "jquery",
+ "./sortable_test_helpers",
+ "ui/sortable"
+], function( $, sortableTestHelpers ) {
module( "sortable: core" );
connectWith: ".connectWith"
});
- TestHelpers.sortable.sort( $( "li", el[ 1 ] )[ 0 ], 0, -12, 5, "Dragging the sortable into connected sortable" );
+ sortableTestHelpers.sort( $( "li", el[ 1 ] )[ 0 ], 0, -12, 5, "Dragging the sortable into connected sortable" );
});
test( "ui-sortable-handle applied to appropriate element", function( assert ) {
equal( el.find( ".ui-sortable-handle" ).length, 0, "class name removed on destroy" );
});
-})( jQuery );
+} );
-/*
- * sortable_methods.js
- */
-(function($) {
+define( [
+ "jquery",
+ "./sortable_test_helpers",
+ "ui/sortable"
+], function( $, sortableTestHelpers ) {
module("sortable: methods");
el = $("#sortable").sortable({ disabled: true });
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable({ disabled: true })");
+ sortableTestHelpers.sort($("li", el)[0], 0, 44, 0, ".sortable({ disabled: true })");
el.sortable("enable");
equal(el.sortable("option", "disabled"), false, "disabled option getter");
el.sortable("option", "disabled", false);
equal(el.sortable("option", "disabled"), false, "disabled option setter");
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable('option', 'disabled', false)");
+ sortableTestHelpers.sort($("li", el)[0], 0, 44, 2, ".sortable('option', 'disabled', false)");
expected = $("<div></div>").sortable(),
actual = expected.sortable("enable");
var chainable,
element = $( "#sortable" ).sortable({ disabled: false });
- TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
+ sortableTestHelpers.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
chainable = element.sortable( "disable" );
- TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 0, "disabled.sortable getter" );
+ sortableTestHelpers.sort( $( "li", element )[ 0 ], 0, 44, 0, "disabled.sortable getter" );
element.sortable( "destroy" );
element.sortable({ disabled: false });
- TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
+ sortableTestHelpers.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
element.sortable( "option", "disabled", true);
equal( element.sortable( "option", "disabled" ), true, "disabled option setter" );
ok( !element.sortable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
assert.hasClasses( element.sortable( "widget" ), "ui-sortable-disabled" );
- TestHelpers.sortable.sort($( "li", element )[ 0 ], 0, 44, 0, ".sortable('option', 'disabled', true)" );
+ sortableTestHelpers.sort($( "li", element )[ 0 ], 0, 44, 0, ".sortable('option', 'disabled', true)" );
equal( chainable, element, "disable is chainable" );
});
equal( changeCount, 1 );
});
-})(jQuery);
+} );