@@ -0,0 +1,76 @@
define( [
"jquery",
"ui/widgets/controlgroup",
"ui/widgets/checkboxradio",
"ui/widgets/selectmenu",
"ui/widgets/button"
], function( $ ) {

module( "Controlgroup: Core" );

test( "selectmenu: open/close corners", function( assert ) {
expect( 12 );
var element = $( ".controlgroup" ).controlgroup(),
selects = element.find( "select" ),
selectButton = selects.eq( 0 ).selectmenu( "widget" );

selects.eq( 0 ).selectmenu( "open" );
assert.hasClasses( selectButton, "ui-corner-tl",
"Horizontal: First selectmenu gets ui-corner-tl when opened" );

selects.eq( 0 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-left",
"Horizontal: First selectmenu gets ui-corner-left when closed" );

selectButton = selects.eq( 1 ).selectmenu( "widget" );
selects.eq( 1 ).selectmenu( "open" );
assert.lacksClassStart( selectButton, "ui-corner" );

selects.eq( 1 ).selectmenu( "close" );
assert.lacksClassStart( selectButton, "ui-corner" );

selectButton = selects.eq( 2 ).selectmenu( "widget" );
selects.eq( 2 ).selectmenu( "open" );
assert.hasClasses( selectButton, "ui-corner-tr",
"Horizontal: Last selectmenu gets ui-corner-tr when opened" );

selects.eq( 2 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-right",
"Horizontal: Last selectmenu gets ui-corner-right when closed" );

element.controlgroup( "option", "direction", "vertical" );
selectButton = selects.eq( 0 ).selectmenu( "widget" );
selects.eq( 0 ).selectmenu( "open" );
assert.hasClasses( selectButton, "ui-corner-top",
"vertical: First selectmenu gets ui-corner-top when opened" );

selects.eq( 0 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-top",
"vertical: First selectmenu gets ui-corner-top when closed" );

selectButton = selects.eq( 1 ).selectmenu( "widget" );
selects.eq( 1 ).selectmenu( "open" );
assert.lacksClassStart( selectButton, "ui-corner" );

selects.eq( 1 ).selectmenu( "close" );
assert.lacksClassStart( selectButton, "ui-corner" );

selectButton = selects.eq( 2 ).selectmenu( "widget" );
selects.eq( 2 ).selectmenu( "open" );
assert.lacksClassStart( selectButton, "ui-corner" );

selects.eq( 2 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-bottom",
"vertical: Last selectmenu gets ui-corner-bottom when closed" );
} );

test( "selectmenu: controlgroupLabel", function( assert ) {
expect( 2 );
var element = $( ".controlgroup" ).controlgroup();
var label = element.find( ".ui-controlgroup-label" );

assert.hasClasses( label, "ui-widget ui-widget-content ui-state-default ui-controlgroup-item" );
assert.hasClasses( label.find( "span" ), "ui-controlgroup-label-contents" );
} );

} );
@@ -0,0 +1,150 @@
define( [
"jquery",
"ui/widgets/controlgroup",
"ui/widgets/checkboxradio",
"ui/widgets/selectmenu",
"ui/widgets/button"
], function( $ ) {

module( "Controlgroup: methods" );

test( "destroy", function( assert ) {
expect( 1 );
assert.domEqual( ".controlgroup", function() {
$( ".controlgroup" ).controlgroup().controlgroup( "destroy" );
} );
} );

test( "disable", function( assert ) {
expect( 2 );
var element = $( ".controlgroup" ).controlgroup().controlgroup( "disable" );
assert.lacksClasses( element, "ui-state-disabled",
"The widget does not get the disabled class, because we disable each child widget" );
strictEqual( element.find( ".ui-state-disabled" ).length, 6,
"Child widgets are disabled" );
} );

test( "enable", function( assert ) {
expect( 2 );
var element = $( ".controlgroup" ).controlgroup().controlgroup( "enable" );
assert.lacksClasses( element, "ui-state-disabled",
"ui-state-disabled is not present on widget after enabling" );
strictEqual( element.find( "ui-state-disabled" ).length, 0,
"Child widgets are disabled" );
} );

var tests = {
"checkboxradio": "<input type='checkbox'>",
"selectmenu": "<select><option>foo</option></select>",
"button": "<button>button text</button>"
},
orientations = {
"horizontal": [
"ui-corner-left",
false,
false,
"ui-corner-right"
],
"vertical": [
"ui-corner-top",
false,
false,
"ui-corner-bottom"
]
};

// Iterate through supported element markup
$.each( tests, function( widget, html ) {

// Check in both horizontal and vertical orientations
$.each( orientations, function( name, classes ) {

test( "refresh: " + widget + ": " + name, function( assert ) {
expect( 41 );

var i, control, currentClasses,
controls = [],
element = $( "<div>" ).controlgroup( {
direction: name
} ).appendTo( "body" );

// checks the elements with in the controlgroup against the expected class list
function checkCornerClasses( classList ) {
for ( var j = 0; j < 4; j++ ) {
if ( classList[ j ] ) {
assert.hasClasses( controls[ j ][ widget ]( "widget" ), classList[ j ] );
} else {
assert.lacksClassStart( controls[ j ][ widget ]( "widget" ), "ui-corner" );
}
}
}

function showElements( index, value ) {
$( value )[ widget ]( "widget" ).show();
}

// Hide each element and check the corner classes
function iterateHidden( onlyVisible ) {
for ( i = 0; i < 4; i++ ) {

$( controls ).each( showElements );

controls[ i ][ widget ]( "widget" ).hide();

currentClasses = classes.slice( 0 );
if ( onlyVisible ) {
if ( i === 0 ) {
currentClasses[ i + 1 ] = classes[ i ];
currentClasses[ i ] = false;
} else if ( i === 3 ) {
currentClasses[ i - 1 ] = classes[ i ];
currentClasses[ i ] = false;
}
}
element.controlgroup( "refresh" );
checkCornerClasses( currentClasses );
}
}

// Add a label for each element and then append the element to the control group
for ( i = 0; i < 4; i++ ) {
control = $( html ).attr( "id", "id" + i )
.add( $( "<label>label text</label>" ).clone().attr( "for", "id" + i ) );

controls.push( control );
element.append( control );
}

// Refresh the controlgroup now that its populated
element.controlgroup( "refresh" );
for ( i = 0; i < 4; i++ ) {
strictEqual( controls[ i ].is( ":ui-" + widget ), true,
name + ": " + widget + " " + i + ": is a " + widget + " widget" );
}

// Check that we have the right classes
checkCornerClasses( classes );

// hide each element and then check its classes
iterateHidden( true );

// Set the exclude option to false so we no longer care about hidden
element.controlgroup( "option", "onlyVisible", false );

// Iterate hiding the elements again and check their corner classes
iterateHidden();

// Disable the first control
controls[ 0 ].prop( "disabled", true );

element.controlgroup( "refresh" );

assert.hasClasses( controls[ 0 ][ widget ]( "widget" ), "ui-state-disabled" );

// remove the controlgroup before we start the next set
element.remove();
} );
} );
} );

} );
@@ -0,0 +1,109 @@
define( [
"jquery",
"ui/widgets/controlgroup",
"ui/widgets/checkboxradio",
"ui/widgets/selectmenu",
"ui/widgets/button"
], function( $ ) {

module( "Controlgroup: options" );

test( "disabled", function( assert ) {
expect( 4 );
var element = $( ".controlgroup" ).controlgroup().controlgroup( "option", "disabled", true );
assert.lacksClasses( element, "ui-state-disabled" );
equal( element.find( ".ui-state-disabled" ).length, 6, "Child widgets are disabled" );

element.controlgroup( "option", "disabled", false );
assert.lacksClasses( element, "ui-state-disabled" );
strictEqual( element.find( ".ui-state-disabled" ).length, 0, "Child widgets are not disabled" );

} );

test( "items - null", function() {
expect( 2 );
var element = $( ".controlgroup" ).controlgroup( {
items: {
"button": null,
"selectmenu": null,
"checkboxradio": null
}
} );

strictEqual( element.children( ".ui-button" ).length, 0,
"Child widgets are not called when selector is null" );

element.controlgroup( "option", "items", {
"button": "button"
} );
strictEqual( element.children( ".ui-button" ).length, 2,
"Correct child widgets are called when selector is updated" );
} );

test( "items: custom selector", function() {
expect( 1 );
var element = $( ".controlgroup" ).controlgroup( {
items: {
"button": ".button"
}
} );
strictEqual( element.children( ".ui-button" ).length, 4,
"Correct child widgets are called when custom selector used" );
} );

$.widget( "ui.test", {
_create: function() {
this.element.addClass( "ui-test ui-button" );
},

// Controlgroup requires a refresh method to exist
refresh: $.noop
} );

test( "items: custom widget", function() {
expect( 2 );
var element = $( ".controlgroup" ).controlgroup( {
items: {
"test": ".test"
}
} );

strictEqual( element.children( ".ui-button" ).length, 7,
"Correct child widgets are called when custom selector used" );
strictEqual( element.children( ".ui-test" ).length, 1,
"Custom widget called" );
} );

test( "onlyVisible", function( assert ) {
expect( 4 );
var element = $( ".controlgroup" ).controlgroup( {
onlyVisible: false
} ),
buttons = element.children( ".ui-button" );

assert.lacksClassStart( buttons.eq( 1 ), "ui-corner" );
assert.hasClasses( buttons.eq( 0 ), "ui-corner-left",
"onlyVisible: false: First button hidden second button doesn't get a corner class" );

element.controlgroup( "option", "onlyVisible", true );
assert.lacksClassStart( buttons.eq( 0 ), "ui-corner" );
assert.hasClasses( buttons.eq( 1 ), "ui-corner-left",
"onlyVisible: true: First button is hidden second button get corner class" );
} );

test( "direction", function( assert ) {
expect( 6 );
var element = $( ".controlgroup" ).controlgroup(),
buttons = element.children( ".ui-button" ).filter( ":visible" );

assert.hasClasses( element, "ui-controlgroup-horizontal" );
assert.hasClasses( buttons.first(), "ui-corner-left" );
assert.hasClasses( buttons.last(), "ui-corner-right" );

element.controlgroup( "option", "direction", "vertical" );
assert.hasClasses( element, "ui-controlgroup-vertical" );
assert.hasClasses( buttons.first(), "ui-corner-top" );
assert.hasClasses( buttons.last(), "ui-corner-bottom" );
} );

} );
@@ -154,7 +154,7 @@ test( "Months", 5, function() {
ok( lastMonth.last );
ok( !lastMonth.first );

ok( firstMonth.month() === lastMonth.month() - 1 );
equal( firstMonth.month(), lastMonth.month() - 1 );
} );

test( "Equal", 4, function() {
@@ -156,21 +156,19 @@ test( "buttons - advanced", function( assert ) {
click: function() {
equal( this, element[ 0 ], "correct context" );
},
icons: {
primary: "ui-icon-cancel"
},
showText: false
icon: "ui-icon-cancel",
showLabel: false
}
]
} );

buttons = element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" );
equal( buttons.length, 1, "correct number of buttons" );
equal( buttons.attr( "id" ), "my-button-id", "correct id" );
equal( buttons.text(), "a button", "correct label" );
equal( $.trim( buttons.text() ), "a button", "correct label" );
assert.hasClasses( buttons, "additional-class" );
deepEqual( buttons.button( "option", "icons" ), { primary: "ui-icon-cancel", secondary: null } );
equal( buttons.button( "option", "text" ), false );
deepEqual( buttons.button( "option", "icon" ), "ui-icon-cancel" );
equal( buttons.button( "option", "showLabel" ), false );
buttons.trigger( "click" );

element.remove();
@@ -208,22 +206,27 @@ test( "closeOnEscape", function() {
} );

test( "closeText", function() {
expect( 3 );
expect( 4 );

var element = $( "<div></div>" ).dialog();
equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close span" ).text(), "Close",
equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "Close",
"default close text" );
element.remove();

element = $( "<div></div>" ).dialog( { closeText: "foo" } );
equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close span" ).text(), "foo",
equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "foo",
"closeText on init" );
element.remove();

element = $( "<div></div>" ).dialog().dialog( "option", "closeText", "bar" );
equal( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close span" ).text(), "bar",
equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "bar",
"closeText via option method" );
element.remove();

element = $( "<div></div>" ).dialog( { closeText: "<span>foo</span>" } );
equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "<span>foo</span>",
"closeText is escaped" );
element.remove();
} );

test( "draggable", function() {
@@ -345,4 +345,27 @@ test( "ui-draggable-handle managed correctly in nested draggables", function( as
assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" );
} );

// Support: IE 8 only
// IE 8 implements DOM Level 2 Events which only has events bubble up to the document.
// We skip this test since it would be impossible for it to pass in such an environment.
QUnit[ document.documentMode === 8 ? "skip" : "test" ](
"does not stop propagation to window",
function( assert ) {
expect( 1 );
var element = $( "#draggable1" ).draggable();

var handler = function() {
assert.ok( true, "mouseup propagates to window" );
};
$( window ).on( "mouseup", handler );

element.simulate( "drag", {
dx: 10,
dy: 10
} );

$( window ).off( "mouseup", handler );
}
);

} );
@@ -48,7 +48,7 @@
}
.sortable {
position: relative;
top: 8000px;
top: 800px;
left: 10px;
width: 300px;
padding: 0;
@@ -81,17 +81,17 @@
<div style="width: 1px; height: 1000px;"></div>
<div style="position: absolute; width: 1px; height: 2000px;"></div>
<ul id="sortable" class="sortable">
<li id="draggableSortable">Item 0</li>
<li id="draggableSortable2">Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<ul id="sortable2" class="sortable">
<li id="draggableSortableClone" class="sortable2Item">Item 0</li>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<li id="draggableSortable">Item 0</li>
<li id="draggableSortable2">Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<ul id="sortable2" class="sortable">
<li id="draggableSortableClone" class="sortable2Item">Item 0</li>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>

</body>
@@ -6,6 +6,8 @@ define( [
"ui/widgets/sortable"
], function( $, testHelper ) {

module( "draggable: options" );

// TODO: This doesn't actually test whether append happened, possibly remove
test( "{ appendTo: 'parent' }, default, no clone", function() {
expect( 4 );
@@ -41,6 +41,8 @@ <h2>Widgets</h2>
<li><a href="autocomplete/autocomplete.html">Autocomplete</a></li>
<li><a href="calendar/calendar.html">Calendar</a></li>
<li><a href="button/button.html">Button</a></li>
<li><a href="checkboxradio/checkboxradio.html">Checkboxradio</a></li>
<li><a href="controlgroup/controlgroup.html">Controlgroup</a></li>
<li><a href="datepicker/datepicker.html">Datepicker</a></li>
<li><a href="dialog/dialog.html">Dialog</a></li>
<li><a href="menu/menu.html">Menu</a></li>
@@ -15,7 +15,7 @@ test( "markup structure", function( assert ) {

assert.hasClasses( button,
"ui-selectmenu-button ui-selectmenu-button-closed ui-widget" );
assert.lacksClasses( button, "ui-selectmenu-button-open" );
assert.lacksClasses( button, "ui-selectmenu-button-open ui-selectmenu-open" );
assert.hasClasses( menuWrap, "ui-selectmenu-menu" );
assert.lacksClasses( menuWrap, "ui-selectmenu-menu-open" );
} );
@@ -89,17 +89,17 @@ test( "_renderButtonItem()", function() {
element.selectmenu( "refresh" );
option = element.find( "option:selected" );
equal(
$.trim( button.text() ),
option.text() + element[ 0 ].selectedIndex,
button.text(),
"refresh: button item text"
);

button.trigger( "click" );
menu.find( "li" ).last().simulate( "mouseover" ).trigger( "click" );
option = element.find( "option" ).last();
equal(
$.trim( button.text() ),
option.text() + element[ 0 ].selectedIndex,
button.text(),
"click: button item text"
);
} );
@@ -146,7 +146,7 @@ $.each( [
selected.val(),
"original select state"
);
equal( button.text(), selected.text(), "button text" );
equal( $.trim( button.text() ), selected.text(), "button text" );
start();
} );
} );
@@ -181,7 +181,7 @@ $.each( [
selected.val(),
"original select state"
);
equal( button.text(), selected.text(), "button text" );
equal( $.trim( button.text() ), selected.text(), "button text" );
start();
}, 1 );
} );
@@ -222,7 +222,7 @@ $.each( [
"button aria-activedescendant" );
equal( element.find( "option:selected" ).val(), options.eq( 1 ).val(),
"original select state" );
equal( button.text(), options.eq( 1 ).text(), "button text" );
equal( $.trim( button.text() ), options.eq( 1 ).text(), "button text" );
start();
} );
} );
@@ -329,4 +329,22 @@ $.each( [
} );
} );

asyncTest( "Selectmenu should reset when its parent form resets", function() {
expect( 2 );

var element = $( "#speed" ).selectmenu(),
widget = element.selectmenu( "widget" ),
initialValue = element.val(),
form = element.closest( "form" );

element.val( "Slower" );
element.selectmenu( "refresh" );
equal( $.trim( widget.text() ), "Slower" );
form[ 0 ].reset();
setTimeout( function() {
equal( $.trim( widget.text() ), initialValue );
start();
} );
} );

} );
@@ -81,21 +81,21 @@ asyncTest( "refresh - change selected option", function() {
var element = $( "#speed" ).selectmenu(),
button = element.selectmenu( "widget" );

equal( element.find( "option:selected" ).text(), button.text(), "button text after init" );
equal( $.trim( button.text() ), "Medium", "button text after init" );

button.simulate( "focus" );

setTimeout( function() {
equal( element.find( "option:selected" ).text(), button.text(), "button text after focus" );
equal( $.trim( button.text() ), "Medium", "button text after focus" );

element[ 0 ].selectedIndex = 0;
element.selectmenu( "refresh" );
equal( element.find( "option:selected" ).text(), button.text(),
"button text after changing selected option" );
equal( $.trim( button.text() ), "Slower", "button text after changing selected option" );

element.find( "option" ).prop( "selected", false );
element.append( "<option selected value=\"selected_option\">Selected option</option>" );
element.selectmenu( "refresh" );
equal( "Selected option", button.text(), "button text after adding selected option" );
equal( $.trim( button.text() ), "Selected option", "button text after adding selected option" );

start();
} );
@@ -180,7 +180,7 @@ test( "widget and menuWidget", function( assert ) {
menu = element.selectmenu( "menuWidget" );

equal( button.length, 1, "button: one element" );
assert.hasClasses( button, "ui-selectmenu-button" );
assert.hasClasses( button, "ui-button" );

equal( menu.length, 1, "Menu Widget: one element" );
ok( menu.is( "ul.ui-menu" ), "Menu Widget: element and class" );
@@ -3,9 +3,8 @@
<head>
<meta charset="utf-8">
<title>jQuery UI Selectmenu Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core menu selectmenu"></script>
<script src="../../lib/css.js" data-modules="core menu selectmenu button"></script>
<script src="../../lib/bootstrap.js" data-widget="selectmenu"></script>
</head>
<body>
@@ -14,7 +13,7 @@
<div id="qunit-fixture">
<div id="selectmenu-wrap1" class="selectmenu-wrap"></div>

<div id="selectmenu-wrap2" class="selectmenu-wrap">
<form id="selectmenu-wrap2" class="selectmenu-wrap">
<label for="speed">Select a speed:</label>
<select name="speed" id="speed">
<option value="Slower">Slower</option>
@@ -23,7 +22,7 @@
<option value="Fast">Fast</option>
<option value="Faster">Faster</option>
</select>
</div>
</form>

<label for="number">Select a number:</label>
<select name="number" id="number">
@@ -111,8 +111,54 @@ test( "value", function() {
equal( element.slider( "value" ), 460, "value is restricted to maximum valid step" );
} );

//test( "values", function() {
// ok(false, "missing test - untested code is broken code." );
//});
test( "values, single step", function() {
expect( 8 );

var element = $( "<div></div>" ).slider( {
range: false,
min: 10,
max: 100,
step: 1,
values: [ 20 ]
} );

deepEqual( element.slider( "values" ), [ 20 ], "range: false, values - get value for handle" );
equal( element.slider( "values", 0 ), 20, "values (index) - get value of handle" );

element.slider( "values", 0, 5 );
equal( element.slider( "values", 0 ), 10, "values (index) - restrict against min" );

element.slider( "values", 0, 110 );
equal( element.slider( "values", 0 ), 100, "values (index) - restrict against max" );

element.slider( "option", "range", true );
element.slider( "values", [ 20, 90 ] );

deepEqual( element.slider( "values" ), [ 20, 90 ], "range: true, values - get value for all handles" );
equal( element.slider( "values", 0 ), 20, "values (index) - 1st handle" );
equal( element.slider( "values", 1 ), 90, "values (index) - 2nd handle" );

element.slider( "values", [ 5, 110 ] );
deepEqual( element.slider( "values" ), [ 10, 100 ], "values - restricted against min and max" );
element.slider( "destroy" );
} );

test( "values, multi step", function() {
expect( 2 );

var element = $( "<div></div>" ).slider( {
range: false,
min: 9,
max: 20,
step: 3,
values: [ 9, 12 ]
} );
deepEqual( element.slider( "values" ), [ 9, 12 ], "values - evenly divisible by step" );

element.slider( "values", [ 10, 20 ] );
deepEqual( element.slider( "values" ), [ 9, 18 ], "values - not evenly divisible by step" );

element.slider( "destroy" );
} );

} );
@@ -87,7 +87,6 @@ asyncTest( "#7415: Incorrect revert animation with axis: 'y'", function() {
element = $( "#sortable" ).sortable( {
axis: "y",
revert: true,
stop: start,
sort: function() {
expectedLeft = item.css( "left" );
}
@@ -103,6 +102,7 @@ asyncTest( "#7415: Incorrect revert animation with axis: 'y'", function() {
var top = parseFloat( item.css( "top" ) );
equal( item.css( "left" ), expectedLeft, "left not animated" );
ok( top > 0 && top < 300, "top is animated" );
start();
}, 100 );
} );

@@ -6,7 +6,7 @@ var versions = [
"1.9.0", "1.9.1",
"1.10.0", "1.10.1", "1.10.2",
"1.11.0", "1.11.1", "1.11.2", "1.11.3",
"compat-git"
"git"
],
additionalTests = {

@@ -47,7 +47,10 @@ return $.extend( helper, {

equalHeight: function( tabs, height ) {
tabs.find( ".ui-tabs-panel" ).each( function() {
equal( $( this ).outerHeight(), height );

// Handle overly-precise values
var actualHeight = parseFloat( $( this ).outerHeight().toFixed( 1 ) );
equal( actualHeight, height );
} );
},

This file was deleted.

This file was deleted.

@@ -0,0 +1,65 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI - Checkboxes</title>
<link rel="stylesheet" href="../../../themes/base/all.css">
<script src="../../../external/jquery/jquery.js"></script>
<script src="../../../ui/core.js"></script>
<script src="../../../ui/widget.js"></script>
<script src="../../../ui/button.js"></script>
<script src="../../../ui/checkboxradio.js"></script>
<script>
$(function() {
var checkboxes = $( "form input" ).checkboxradio();

$( ".controls input, .controls select" ).on( "change keyup", function() {
var option = $( this ).attr( "name" ),
value = $( this ).val();

if ( $( this ).is( "[type=checkbox]" ) ) {
value = $( this ).is( ":checked" );
}
if ( option != "label" || value !== "" ) {
checkboxes.checkboxradio( "option", option, value );
}
});
$( ".controls > button" ).click( function() {
if ( this.id !== "create" ) {
checkboxes.checkboxradio( this.id );
} else {
checkboxes.checkboxradio();
}
});
});
</script>
<style>
#format { margin-top: 2em; }
</style>
</head>
<body>
<h2>
Easy way to toggle through various combinations of options and states to make sure none lead to
a broken appearence.
</h2>
<div class="controls">
<button id="create">Create</button>
<button id="destroy">Destroy</button>
<button id="enable">Enable</button>
<button id="disable">Disable</button>
<button id="refresh">Refresh</button>
<input type="checkbox" id="icon" name="icon" checked><label for="icon">Icon</label>
<input type="checkbox" id="disabled" name="disabled"><label for="disabled">Disabled</label>
<label for="label">Label<input type="text" id="label" name="label"></label>
</div>
<form>
<input type="checkbox" id="checkbox-1">
<label for="checkbox-1">Checkbox widget sample</label>
<input type="checkbox" id="checkbox-2"><label for="checkbox-2">Checkbox widget sample</label>

<label for="radio-1">Radio widget sample <input type="radio" id="radio-1" name="radio" checked></label>
<input type="radio" id="radio-2" name="radio"><label for="radio-2"><span>boom</span>Radio widget sample 2</label>
<button type="reset">Reset</button>
</form>
</body>
</html>
@@ -31,6 +31,11 @@ <h2>Button</h2>
<li><a href="button/performance.html">Performance</a></li>
</ul>

<h2>Checkboxradio</h2>
<ul>
<li><a href="checkboxradio/checkboxradio.html">General</a></li>
</ul>

<h2>Dialog</h2>
<ul>
<li><a href="dialog/animated.html">Animations</a></li>
@@ -16,18 +16,6 @@
padding: .5em .5em .5em .7em;
font-size: 100%;
}
.ui-accordion .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
position: absolute;
left: .5em;
top: 50%;
margin-top: -8px;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
@@ -14,6 +14,8 @@
@import url("autocomplete.css");
@import url("button.css");
@import url("calendar.css");
@import url("checkboxradio.css");
@import url("controlgroup.css");
@import url("datepicker.css");
@import url("dialog.css");
@import url("draggable.css");
@@ -9,104 +9,72 @@
* http://api.jqueryui.com/button/#theming
*/
.ui-button {
padding: .4em 1em;
display: inline-block;
position: relative;
padding: 0;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
overflow: visible; /* removes extra width in IE */
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

/* Support: IE <= 11 */
overflow: visible;
}

.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}

/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2.2em;
}
/* button elements seem to need a little more width */
button.ui-button-icon-only {
width: 2.4em;
}
.ui-button-icons-only {
width: 3.4em;
}
button.ui-button-icons-only {
width: 3.7em;
width: 2em;
box-sizing: border-box;
text-indent: -9999px;
white-space: nowrap;
}

/* button text element */
.ui-button .ui-button-text {
display: block;
line-height: normal;
}
.ui-button-text-only .ui-button-text {
padding: .4em 1em;
}
.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
padding: 0;
text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
padding-left: 2.1em;
padding-right: 2.1em;
}
/* no icon support for input elements, provide padding by default */
input.ui-button {
padding: .4em 1em;
/* no icon support for input elements */
input.ui-button.ui-button-icon-only {
text-indent: 0;
}

/* button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
.ui-button-icon-only .ui-icon {
position: absolute;
top: 50%;
margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
left: 50%;
margin-top: -8px;
margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary,
.ui-button-text-icons .ui-button-icon-primary,
.ui-button-icons-only .ui-button-icon-primary {
left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary,
.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
right: .5em;
}

/* button sets */
.ui-buttonset {
margin-right: 7px;
.ui-button.ui-icon-notext .ui-icon {
padding: 0;
width: 2.1em;
height: 2.1em;
text-indent: -9999px;
white-space: nowrap;

}
.ui-buttonset .ui-button {
margin-left: 0;
margin-right: -.3em;

input.ui-button.ui-icon-notext .ui-icon {
width: auto;
height: auto;
text-indent: 0;
white-space: normal;
padding: .4em 1em;
}

/* workarounds */
/* reset extra padding in Firefox, see h5bp.com/l */
/* Support: Firefox 5 - 40 */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
@@ -0,0 +1,34 @@
/*!
* jQuery UI Checkboxradio @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/checkboxradio/#theming
*/

.ui-checkboxradio-label .ui-icon-background {
box-shadow: inset 1px 1px 1px #ccc;
border-radius: .12em;
border: none;
}
.ui-checkboxradio-radio-label .ui-icon-background {
width: 16px;
height: 16px;
border-radius: 1em;
overflow: visible;
border: none;
}
.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
background-image: none;
width: 8px;
height: 8px;
border-width: 4px;
border-style: solid;
}
.ui-checkboxradio-disabled {
pointer-events: none;
}
@@ -0,0 +1,65 @@
/*!
* jQuery UI Controlgroup @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/controlgroup/#theming
*/

.ui-controlgroup {
vertical-align: middle;
display: inline-block;
}
.ui-controlgroup > .ui-controlgroup-item {
float: left;
margin-left: 0;
margin-right: 0;
}
.ui-controlgroup > .ui-controlgroup-item:focus,
.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
z-index: 9999;
}
.ui-controlgroup-vertical > .ui-controlgroup-item {
display: block;
float: none;
width: 100%;
margin-top: 0;
margin-bottom: 0;
text-align: left;
}
.ui-controlgroup-vertical .ui-controlgroup-item {
box-sizing: border-box;
}
.ui-controlgroup .ui-controlgroup-label {
padding: .4em 1em;
}
.ui-controlgroup .ui-controlgroup-label span {
font-size: 80%;
}
.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
border-left: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
border-top: none;
}
.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
border-right: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
border-bottom: none;
}

/* Spinner specific style fixes */
.ui-controlgroup-vertical .ui-spinner-input {

/* Support: IE8 only, Android < 4.4 only */
width: 75%;
width: calc( 100% - 2.4em );
}
.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
border-top-style: solid;
}

@@ -68,15 +68,21 @@

/* Icons
----------------------------------*/

/* states and images */
.ui-icon {
display: block;
display: inline-block;
vertical-align: middle;
margin-top: -.25em;
position: relative;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}

.ui-widget-icon-block {
left: 50%;
margin-left: -8px;
display: block;
}

/* Misc visuals
----------------------------------*/
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
@@ -33,27 +33,10 @@
.ui-selectmenu-open {
display: block;
}
.ui-selectmenu-button {
display: inline-block;
overflow: hidden;
position: relative;
text-decoration: none;
cursor: pointer;
width: 14em;
}
.ui-selectmenu-button span.ui-icon {
right: 0.5em;
left: auto;
margin-top: -8px;
position: absolute;
top: 50%;
}
.ui-selectmenu-button span.ui-selectmenu-text {
.ui-selectmenu-button.ui-button {
text-align: left;
padding: 0.4em 2.1em 0.4em 1em;
display: block;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 14em;
}
@@ -23,10 +23,10 @@
margin: .2em 0;
vertical-align: middle;
margin-left: .4em;
margin-right: 22px;
margin-right: 2em;
}
.ui-spinner-button {
width: 16px;
width: 1.6em;
height: 50%;
font-size: .5em;
padding: 0;
@@ -40,26 +40,13 @@
}
/* more specificity required here to override default borders */
.ui-spinner a.ui-spinner-button {
border-top: none;
border-bottom: none;
border-right: none;
}
/* vertically center icon */
.ui-spinner .ui-icon {
position: absolute;
margin-top: -8px;
top: 50%;
left: 0;
border-top-style: none;
border-bottom-style: none;
border-right-style: none;
}
.ui-spinner-up {
top: 0;
}
.ui-spinner-down {
bottom: 0;
}

/* TR overrides */
.ui-spinner .ui-icon-triangle-1-s {
/* need to fix icons sprite */
background-position: -65px -16px;
}
@@ -53,15 +53,25 @@
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
.ui-widget-header .ui-state-default,
.ui-button,

/* We use html here because we need a greater specificity to make sure disabled
works properly when clicked or hovered */
html .ui-button.ui-state-disabled:hover,
html .ui-button.ui-state-disabled:active {
border: 1px solid #c5c5c5/*{borderColorDefault}*/;
background: #f6f6f6/*{bgColorDefault}*/ /*{bgImgUrlDefault}*/ /*{bgDefaultXPos}*/ /*{bgDefaultYPos}*/ /*{bgDefaultRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #454545/*{fcDefault}*/;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
.ui-state-default a:visited,
a.ui-button,
a:link.ui-button,
a:visited.ui-button,
.ui-button {
color: #454545/*{fcDefault}*/;
text-decoration: none;
}
@@ -70,7 +80,9 @@
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
.ui-widget-header .ui-state-focus,
.ui-button:hover,
.ui-button:focus {
border: 1px solid #cccccc/*{borderColorHover}*/;
background: #ededed/*{bgColorHover}*/ /*{bgImgUrlHover}*/ /*{bgHoverXPos}*/ /*{bgHoverYPos}*/ /*{bgHoverRepeat}*/;
font-weight: normal/*{fwDefault}*/;
@@ -83,18 +95,32 @@
.ui-state-focus a,
.ui-state-focus a:hover,
.ui-state-focus a:link,
.ui-state-focus a:visited {
.ui-state-focus a:visited,
a.ui-button:hover,
a.ui-button:focus {
color: #2b2b2b/*{fcHover}*/;
text-decoration: none;
}

.ui-visual-focus {
box-shadow: 0 0 3px 1px rgb(94, 158, 214);
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
border: 1px solid #003eff/*{borderColorActive}*/;
background: #007fff/*{bgColorActive}*/ /*{bgImgUrlActive}*/ /*{bgActiveXPos}*/ /*{bgActiveYPos}*/ /*{bgActiveRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #ffffff/*{fcActive}*/;
}
.ui-icon-background,
.ui-state-active .ui-icon-background {
border: #003eff/*{borderColorActive}*/;
background-color: #ffffff/*{fcActive}*/;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
@@ -171,17 +197,22 @@
.ui-widget-header .ui-icon {
background-image: url("images/ui-icons_444444_256x240.png")/*{iconsHeader}*/;
}
.ui-state-default .ui-icon {
.ui-button .ui-icon {
background-image: url("images/ui-icons_777777_256x240.png")/*{iconsDefault}*/;
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
.ui-state-focus .ui-icon,
.ui-button:hover .ui-icon,
.ui-button:focus .ui-icon,
.ui-state-default .ui-icon {
background-image: url("images/ui-icons_555555_256x240.png")/*{iconsHover}*/;
}
.ui-state-active .ui-icon {
.ui-state-active .ui-icon,
.ui-button:active .ui-icon {
background-image: url("images/ui-icons_ffffff_256x240.png")/*{iconsActive}*/;
}
.ui-state-highlight .ui-icon {
.ui-state-highlight .ui-icon,
.ui-button .ui-state-highlight.ui-icon {
background-image: url("images/ui-icons_777620_256x240.png")/*{iconsHighlight}*/;
}
.ui-state-error .ui-icon,
@@ -195,7 +226,7 @@
.ui-icon-caret-1-ne { background-position: -16px 0; }
.ui-icon-caret-1-e { background-position: -32px 0; }
.ui-icon-caret-1-se { background-position: -48px 0; }
.ui-icon-caret-1-s { background-position: -64px 0; }
.ui-icon-caret-1-s { background-position: -65px 0; }
.ui-icon-caret-1-sw { background-position: -80px 0; }
.ui-icon-caret-1-w { background-position: -96px 0; }
.ui-icon-caret-1-nw { background-position: -112px 0; }
@@ -205,7 +236,7 @@
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-s { background-position: -65px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
@@ -215,7 +246,7 @@
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-s { background-position: -65px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
@@ -227,7 +258,7 @@
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
@@ -1,18 +1,3 @@
/*!
* jQuery UI Core @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
*/

//>>label: Core
//>>group: UI Core
//>>description: The core of jQuery UI, required for all interactions and widgets.
//>>docs: http://api.jqueryui.com/category/ui-core/

// This file is deprecated in 1.12.0 to be removed in 1.13
( function() {
define( [
@@ -1,9 +1,17 @@
/*
* Calendar math built on jquery-global
/*!
* jQuery UI Date @VERSION
* http://jqueryui.com
*
* Based on Marc Grabanski's jQuery Date Plugin
* http://marcgrabanski.com/articles/jquery-date-plugin
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: Date
//>>group: Core
//>>description: Calendar math built on Globalize.
//>>docs: http://api.jqueryui.com/date/

( function( factory ) {
if ( typeof define === "function" && define.amd ) {

@@ -29,10 +29,12 @@
}
}( function( $ ) {

var effect;
if ( $.uiBackCompat !== false ) {
return $.effects.define( "transfer", function( options, done ) {
effect = $.effects.define( "transfer", function( options, done ) {
$( this ).transfer( options, done );
} );
}
return effect;

} ) );
@@ -1,3 +1,17 @@
/*!
* jQuery UI Form Reset Mixin @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: Form Reset Mixin
//>>group: Core
//>>description: Refresh input widgets when their form is reset
//>>docs: http://api.jqueryui.com/form-reset-mixin/

( function( factory ) {
if ( typeof define === "function" && define.amd ) {

@@ -9,7 +9,7 @@
*/

//>>label: jQuery 1.7 Support
//>>group: UI Core
//>>group: Core
//>>description: Support version 1.7.x of jQuery core

( function( factory ) {
@@ -10,7 +10,7 @@
*/

//>>label: Position
//>>group: UI Core
//>>group: Core
//>>description: Positions elements relative to other elements.
//>>docs: http://api.jqueryui.com/position/
//>>demos: http://jqueryui.com/position/
@@ -8,7 +8,7 @@
*/

//>>label: Widget
//>>group: UI Core
//>>group: Core
//>>description: Provides a factory for creating stateful widgets with a common API.
//>>docs: http://api.jqueryui.com/jQuery.widget/
//>>demos: http://jqueryui.com/widget/
@@ -12,9 +12,9 @@
//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
//>>docs: http://api.jqueryui.com/accordion/
//>>demos: http://jqueryui.com/accordion/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/accordion.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/accordion.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -12,9 +12,9 @@
//>>description: Lists suggested words as the user is typing.
//>>docs: http://api.jqueryui.com/autocomplete/
//>>demos: http://jqueryui.com/autocomplete/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/autocomplete.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/autocomplete.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -245,24 +245,6 @@ $.widget( "ui.autocomplete", {
this.element.trigger( "focus" );
}
} );

// Clicking on the scrollbar causes focus to shift to the body
// but we can't detect a mouseup or a click immediately afterward
// so we have to track the next mousedown and close the menu if
// the user clicks somewhere outside of the autocomplete
var menuElement = this.menu.element[ 0 ];
if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
this._delay( function() {
var that = this;
this.document.one( "mousedown", function( event ) {
if ( event.target !== that.element[ 0 ] &&
event.target !== menuElement &&
!$.contains( menuElement, event.target ) ) {
that.close();
}
} );
} );
}
},
menufocus: function( event, ui ) {
var label, item;
@@ -368,6 +350,20 @@ $.widget( "ui.autocomplete", {
}
},

_isEventTargetInWidget: function( event ) {
var menuElement = this.menu.element[ 0 ];

return event.target === this.element[ 0 ] ||
event.target === menuElement ||
$.contains( menuElement, event.target );
},

_closeOnClickOutside: function( event ) {
if ( !this._isEventTargetInWidget( event ) ) {
this.close();
}
},

_appendTo: function() {
var element = this.options.appendTo;

@@ -496,6 +492,10 @@ $.widget( "ui.autocomplete", {
},

_close: function( event ) {

// Remove the handler that closes the menu on outside clicks
this._off( this.document, "mousedown" );

if ( this.menu.element.is( ":visible" ) ) {
this.menu.element.hide();
this.menu.blur();
@@ -546,6 +546,11 @@ $.widget( "ui.autocomplete", {
if ( this.options.autoFocus ) {
this.menu.next();
}

// Listen for interactions outside of the widget (#6642)
this._on( this.document, {
mousedown: "_closeOnClickOutside"
} );
},

_resizeMenu: function() {

Large diffs are not rendered by default.

@@ -2,16 +2,19 @@
* jQuery UI Calendar @VERSION
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: Datepicker
//>>label: Calendar
//>>group: Widgets
//>>description: Displays a calendar for inline date selection.
//>>docs: http://api.jqueryui.com/calendar/
//>>demos: http://jqueryui.com/calendar/
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/calendar.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -478,18 +481,23 @@ return $.widget( "ui.calendar", {

// Change the context for the click callback to be the main element
click = props.click;
props.click = function() {
click.apply( that.buttonClickContext, arguments );
};
buttonOptions = {
icons: props.icons,
text: props.showText
icon: props.icon,
iconPosition: props.iconPosition,
showLabel: props.showLabel
};
delete props.icons;
delete props.showText;

delete props.click;
delete props.icon;
delete props.iconPosition;
delete props.showLabel;

$( "<button></button>", props )
.button( buttonOptions )
.appendTo( that.buttonSet );
.appendTo( that.buttonSet )
.on( "click", function() {
click.apply( that.buttonClickContext, arguments );
} );
} );
this.element.addClass( "ui-calendar-buttons" );
this.buttonPane.appendTo( this.element );
@@ -0,0 +1,277 @@
/*!
* jQuery UI Checkboxradio @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: Checkboxradio
//>>group: Widgets
//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
//>>docs: http://api.jqueryui.com/checkboxradio/
//>>demos: http://jqueryui.com/checkboxradio/
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/button.css
//>>css.structure: ../../themes/base/checkboxradio.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [
"jquery",
"../escape-selector",
"../form-reset-mixin",
"../labels",
"../widget"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}( function( $ ) {

$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
version: "@VERSION",
options: {
disabled: null,
label: null,
icon: true,
classes: {
"ui-checkboxradio-label": "ui-corner-all",
"ui-checkboxradio-icon": "ui-corner-all"
}
},

_getCreateOptions: function() {
var disabled, labels;
var that = this;
var options = this._super() || {};

// We read the type here, because it makes more sense to throw a element type error first,
// rather then the error for lack of a label. Often if its the wrong type, it
// won't have a label (e.g. calling on a div, btn, etc)
this._readType();

labels = this.element.labels();

// If there are multiple labels, use the last one
this.label = $( labels[ labels.length - 1 ] );
if ( !this.label.length ) {
$.error( "No label found for checkboxradio widget" );
}

this.originalLabel = "";

// We need to get the label text but this may also need to make sure it does not contain the
// input itself.
this.label.contents().not( this.element ).each( function() {

// The label contents could be text, html, or a mix. We concat each element to get a string
// representation of the label, without the input as part of it.
that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML;
} );

// Set the label option if we found label text
if ( this.originalLabel ) {
options.label = this.originalLabel;
}

disabled = this.element[ 0 ].disabled;
if ( disabled != null ) {
options.disabled = disabled;
}
return options;
},

_create: function() {
var checked = this.element[ 0 ].checked;

this._bindFormResetHandler();

if ( this.options.disabled == null ) {
this.options.disabled = this.element[ 0 ].disabled;
}

this._setOption( "disabled", this.options.disabled );
this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );

if ( this.type === "radio" ) {
this._addClass( this.label, "ui-checkboxradio-radio-label" );
}

if ( this.options.label && this.options.label !== this.originalLabel ) {
this._updateLabel();
} else if ( this.originalLabel ) {
this.options.label = this.originalLabel;
}

this._enhance();

if ( checked ) {
this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
this._addClass( this.icon, null, "ui-state-hover" );
}

this._on( {
change: "_toggleClasses",
focus: function() {
this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
},
blur: function() {
this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
}
} );
},

_readType: function() {
var nodeName = this.element[ 0 ].nodeName.toLowerCase();
this.type = this.element[ 0 ].type;
if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
$.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
" and element.type=" + this.type );
}
},

// Support jQuery Mobile enhanced option
_enhance: function() {
this._updateIcon( this.element[ 0 ].checked );
},

widget: function() {
return this.label;
},

_getRadioGroup: function() {
var group;
var name = this.element[ 0 ].name;
var nameSelector = "input[name='" + $.ui.escapeSelector( name ) + "']";

if ( !name ) {
return $( [] );
}

if ( this.form.length ) {
group = $( this.form[ 0 ].elements ).filter( nameSelector );
} else {

// Not inside a form, check all inputs that also are not inside a form
group = $( nameSelector ).filter( function() {
return $( this ).form().length === 0;
} );
}

return group.not( this.element );
},

_toggleClasses: function() {
var checked = this.element[ 0 ].checked;
this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );

if ( this.options.icon && this.type === "checkbox" ) {

// We add ui-state-highlight to change the icon color
this._toggleClass( this.icon, null, "ui-icon-check ui-state-highlight", checked )
._toggleClass( this.icon, null, "ui-icon-blank", !checked );
}
if ( this.type === "radio" ) {
this._getRadioGroup()
.each( function() {
var instance = $( this ).checkboxradio( "instance" );

if ( instance ) {
instance._removeClass( instance.label,
"ui-checkboxradio-checked", "ui-state-active" );
}
} );
}
},

_destroy: function() {
this._unbindFormResetHandler();

if ( this.icon ) {
this.icon.remove();
this.iconSpace.remove();
}
},

_setOption: function( key, value ) {

// We don't allow the value to be set to nothing
if ( key === "label" && !value ) {
return;
}

this._super( key, value );

if ( key === "disabled" ) {
this._toggleClass( this.label, null, "ui-state-disabled", value );
this.element[ 0 ].disabled = value;

// Don't refresh when setting disabled
return;
}
this.refresh();
},

_updateIcon: function( checked ) {
var toAdd = "ui-icon ui-icon-background ";

if ( this.options.icon ) {
if ( !this.icon ) {
this.icon = $( "<span>" );
this.iconSpace = $( "<span> </span>" );
this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
}

if ( this.type === "checkbox" ) {
toAdd += checked ? "ui-icon-check ui-state-highlight" : "ui-icon-blank";
this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
} else {
toAdd += "ui-icon-blank";
}
this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
if ( !checked ) {
this._removeClass( this.icon, null, "ui-icon-check ui-state-highlight" );
}
this.icon.prependTo( this.label ).after( this.iconSpace );
} else if ( this.icon !== undefined ) {
this.icon.remove();
this.iconSpace.remove();
delete this.icon;
}
},

_updateLabel: function() {

// Remove the contents of the label ( minus the icon, icon space, and input )
this.label.contents().not( this.element.add( this.icon ).add( this.iconSpace ) ).remove();
this.label.append( this.options.label );
},

refresh: function() {
var checked = this.element[ 0 ].checked,
isDisabled = this.element[ 0 ].disabled;

this._updateIcon( checked );
this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
if ( this.options.label !== null ) {
this._updateLabel();
}

if ( isDisabled !== this.options.disabled ) {
this._setOptions( { "disabled": isDisabled } );
}
}

} ] );

return $.ui.checkboxradio;

} ) );
@@ -0,0 +1,251 @@
/*!
* jQuery UI Controlgroup @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: Controlgroup
//>>group: Widgets
//>>description: Visually groups form control widgets
//>>docs: http://api.jqueryui.com/controlgroup/
//>>demos: http://jqueryui.com/controlgroup/
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/controlgroup.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [
"jquery",
"../widget"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}( function( $ ) {

return $.widget( "ui.controlgroup", {
version: "@VERSION",
defaultElement: "<div>",
options: {
direction: "horizontal",
disabled: null,
onlyVisible: true,
items: {
"button": "input[type=button], input[type=submit], input[type=reset], button, a",
"controlgroupLabel": ".ui-controlgroup-label",
"checkboxradio": "input[type='checkbox'], input[type='radio']",
"selectmenu": "select",
"spinner": ".ui-spinner-input"
}
},

_create: function() {
this._enhance();
},

// To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
_enhance: function() {
this.element.attr( "role", "toolbar" );
this.refresh();
},

_destroy: function() {
this._callChildMethod( "destroy" );
this.childWidgets.removeData( "ui-controlgroup-data" );
this.element.removeAttr( "role" );
if ( this.options.items.controlgroupLabel ) {
this.element
.find( this.options.items.controlgroupLabel )
.find( ".ui-controlgroup-label-contents" )
.contents().unwrap();
}
},

_initWidgets: function() {
var that = this,
childWidgets = [];

// First we iterate over each of the items options
$.each( this.options.items, function( widget, selector ) {
var labels;
var options = {};

// Make sure the widget has a selector set
if ( !selector ) {
return;
}

if ( widget === "controlgroupLabel" ) {
labels = that.element.find( selector );
labels.each( function() {
$( this ).contents().wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
} );
that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
childWidgets = childWidgets.concat( labels.get() );
return;
}

// Make sure the widget actually exists
if ( !$.fn[ widget ] ) {
return;
}

// We assume everything is in the middle to start because we can't determine
// first / last elements until all enhancments are done.
if ( that[ "_" + widget + "Options" ] ) {
options = that[ "_" + widget + "Options" ]( "middle" );
}

// Find instances of this widget inside controlgroup and init them
that.element
.find( selector )[ widget ]( options )
.each( function() {
var element = $( this );

// Store an instance of the controlgroup to be able to reference
// from the outermost element for changing options and refresh
var widgetElement = element[ widget ]( "widget" );
$.data( widgetElement[ 0 ], "ui-controlgroup-data",
element[ widget ]( "instance" ) );

childWidgets.push( widgetElement[ 0 ] );
} );
} );

this.childWidgets = $( $.unique( childWidgets ) );
this._addClass( this.childWidgets, "ui-controlgroup-item" );
},

_callChildMethod: function( method ) {
this.childWidgets.each( function() {
var element = $( this ),
data = element.data( "ui-controlgroup-data" );
if ( data && data[ method ] ) {
data[ method ]();
}
} );
},

_updateCornerClass: function( element, position ) {
var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right";
var add = this._buildSimpleOptions( position, "label" ).classes.label;

this._removeClass( element, null, remove );
this._addClass( element, null, add );
},

_buildSimpleOptions: function( position, key ) {
var direction = this.options.direction === "vertical";
var result = {
classes: {}
};
result.classes[ key ] = {
"middle": null,
"first": "ui-corner-" + ( direction ? "top" : "left" ),
"last": "ui-corner-" + ( direction ? "bottom" : "right" )
}[ position ];

return result;
},

_spinnerOptions: function( position ) {
var options = this._buildSimpleOptions( position, "ui-spinner" );

options.classes[ "ui-spinner-up" ] = "";
options.classes[ "ui-spinner-down" ] = "";

return options;
},

_buttonOptions: function( position ) {
return this._buildSimpleOptions( position, "ui-button" );
},

_checkboxradioOptions: function( position ) {
return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
},

_selectmenuOptions: function( position ) {
var direction = this.options.direction === "vertical";
return {
width: direction ? "auto" : false,
classes: {
middle: {
"ui-selectmenu-button-open": null,
"ui-selectmenu-button-closed": null
},
first: {
"ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
},
last: {
"ui-selectmenu-button-open": direction ? null : "ui-corner-tr",
"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
}

}[ position ]
};
},

_setOption: function( key, value ) {
if ( key === "direction" ) {
this._removeClass( "ui-controlgroup-" + this.options.direction );
}

this._super( key, value );
if ( key === "disabled" ) {
this._callChildMethod( value ? "disable" : "enable" );
return;
}

this.refresh();
},

refresh: function() {
var children,
that = this;

this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );

if ( this.options.direction === "horizontal" ) {
this._addClass( null, "ui-helper-clearfix" );
}
this._initWidgets();

children = this.childWidgets;

// We filter here because we need to track all childWidgets not just the visible ones
if ( this.options.onlyVisible ) {
children = children.filter( ":visible" );
}

if ( children.length ) {

// We do this last because we need to make sure all enhancment is done
// before determining first and last
$.each( [ "first", "last" ], function( index, value ) {
var instance = children[ value ]().data( "ui-controlgroup-data" );

if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
instance.element[ instance.widgetName ](
that[ "_" + instance.widgetName + "Options" ]( value )
);
} else {
that._updateCornerClass( children[ value ](), value );
}
} );

// Finally call the refresh method on each of the child widgets.
this._callChildMethod( "refresh" );
}
}
} );
} ) );
@@ -12,6 +12,10 @@
//>>description: Displays a calendar for input-based date selection.
//>>docs: http://api.jqueryui.com/datepicker/
//>>demos: http://jqueryui.com/datepicker/
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/calendar.css
//>>css.structure: ../../themes/base/datepicker.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -12,9 +12,9 @@
//>>description: Displays customizable dialog windows.
//>>docs: http://api.jqueryui.com/dialog/
//>>demos: http://jqueryui.com/dialog/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/dialog.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/dialog.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -426,11 +426,9 @@ $.widget( "ui.dialog", {
// dialog in IE (#9312)
this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
.button( {
label: this.options.closeText,
icons: {
primary: "ui-icon-closethick"
},
text: false
label: $( "<a>" ).text( this.options.closeText ).html(),
icon: "ui-icon-closethick",
showLabel: false
} )
.appendTo( this.uiDialogTitlebar );

@@ -498,12 +496,15 @@ $.widget( "ui.dialog", {
// Change the context for the click callback to be the main element
click = props.click;
buttonOptions = {
icons: props.icons,
text: props.showText
icon: props.icon,
iconPosition: props.iconPosition,
showLabel: props.showLabel
};
delete props.icons;
delete props.showText;

delete props.click;
delete props.icon;
delete props.iconPosition;
delete props.showLabel;

$( "<button></button>", props )
.button( buttonOptions )
@@ -714,7 +715,7 @@ $.widget( "ui.dialog", {
this.uiDialogTitlebarClose.button( {

// Ensure that we always pass a string
label: "" + value
label: $( "<a>" ).text( "" + this.options.closeText ).html()
} );
}

@@ -12,7 +12,7 @@
//>>description: Enables dragging functionality for any element.
//>>docs: http://api.jqueryui.com/draggable/
//>>demos: http://jqueryui.com/draggable/
//>>css.structure: ../themes/base/draggable.css
//>>css.structure: ../../themes/base/draggable.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -255,7 +255,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
if ( !noPropagation ) {
var ui = this._uiHash();
if ( this._trigger( "drag", event, ui ) === false ) {
this._mouseUp( {} );
this._mouseUp( new $.Event( "mouseup", event ) );
return false;
}
this.position = ui.position;
@@ -322,7 +322,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
cancel: function() {

if ( this.helper.is( ".ui-draggable-dragging" ) ) {
this._mouseUp( {} );
this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
} else {
this._clear();
}
@@ -12,9 +12,9 @@
//>>description: Creates nestable menus.
//>>docs: http://api.jqueryui.com/menu/
//>>demos: http://jqueryui.com/menu/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/menu.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/menu.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -8,7 +8,7 @@
*/

//>>label: Mouse
//>>group: UI Core
//>>group: Widgets
//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
//>>docs: http://api.jqueryui.com/mouse/

@@ -146,7 +146,16 @@ return $.widget( "ui.mouse", {

// Iframe mouseup check - mouseup occurred in another document
} else if ( !event.which ) {
return this._mouseUp( event );

// Support: Safari <=8 - 9
// Safari sets which to 0 if you press any of the following keys
// during a drag (#14461)
if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
this.ignoreMissingWhich = true;
} else if ( !this.ignoreMissingWhich ) {
return this._mouseUp( event );
}
}
}

@@ -188,8 +197,9 @@ return $.widget( "ui.mouse", {
delete this._mouseDelayTimer;
}

this.ignoreMissingWhich = false;
mouseHandled = false;
return false;
event.preventDefault();
},

_mouseDistanceMet: function( event ) {
@@ -12,9 +12,9 @@
//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
//>>docs: http://api.jqueryui.com/progressbar/
//>>demos: http://jqueryui.com/progressbar/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/progressbar.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/progressbar.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -12,9 +12,9 @@
//>>description: Enables resize functionality for any element.
//>>docs: http://api.jqueryui.com/resizable/
//>>demos: http://jqueryui.com/resizable/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/resizable.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/resizable.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -99,7 +99,7 @@ $.widget( "ui.resizable", $.ui.mouse, {

_create: function() {

var n, i, handle, axis, hname,
var n, i, handle, axis, hname, margins,
that = this,
o = this.options;
this._addClass( "ui-resizable" );
@@ -131,18 +131,15 @@ $.widget( "ui.resizable", $.ui.mouse, {

this.elementIsWrapper = true;

this.element.css( {
marginLeft: this.originalElement.css( "marginLeft" ),
margins = {
marginTop: this.originalElement.css( "marginTop" ),
marginRight: this.originalElement.css( "marginRight" ),
marginBottom: this.originalElement.css( "marginBottom" )
} );
this.originalElement.css( {
marginLeft: 0,
marginTop: 0,
marginRight: 0,
marginBottom: 0
} );
marginBottom: this.originalElement.css( "marginBottom" ),
marginLeft: this.originalElement.css( "marginLeft" )
};

this.element.css( margins );
this.originalElement.css( "margin", 0 );

// support: Safari
// Prevent Safari textarea resize
@@ -157,7 +154,7 @@ $.widget( "ui.resizable", $.ui.mouse, {

// Support: IE9
// avoid IE jump (hard set the margin)
this.originalElement.css( { margin: this.originalElement.css( "margin" ) } );
this.originalElement.css( margins );

this._proportionallyResize();
}
@@ -690,8 +687,8 @@ $.widget( "ui.resizable", $.ui.mouse, {

this._addClass( this.helper, this._helper );
this.helper.css( {
width: this.element.outerWidth() - 1,
height: this.element.outerHeight() - 1,
width: this.element.outerWidth(),
height: this.element.outerHeight(),
position: "absolute",
left: this.elementOffset.left + "px",
top: this.elementOffset.top + "px",
@@ -1035,7 +1032,7 @@ $.ui.plugin.add( "resizable", "alsoResize", {
},

stop: function() {
$( this ).removeData( "resizable-alsoresize" );
$( this ).removeData( "ui-resizable-alsoresize" );
}
} );

@@ -12,7 +12,7 @@
//>>description: Allows groups of elements to be selected with the mouse.
//>>docs: http://api.jqueryui.com/selectable/
//>>demos: http://jqueryui.com/selectable/
//>>css.structure: ../themes/base/selectable.css
//>>css.structure: ../../themes/base/selectable.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -12,9 +12,9 @@
//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
//>>docs: http://api.jqueryui.com/selectmenu/
//>>demos: http://jqueryui.com/selectmenu/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/selectmenu.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -24,6 +24,7 @@
"jquery",
"./menu",
"../escape-selector",
"../form-reset-mixin",
"../keycode",
"../labels",
"../position",
@@ -38,7 +39,7 @@
}
}( function( $ ) {

return $.widget( "ui.selectmenu", {
return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
version: "@VERSION",
defaultElement: "<select>",
options: {
@@ -76,13 +77,14 @@ return $.widget( "ui.selectmenu", {

this._drawButton();
this._drawMenu();
this._bindFormResetHandler();

this._rendered = false;
this.menuItems = $();
},

_drawButton: function() {
var icon,
var icon, space,
that = this,
item = this._parseOption(
this.element.find( "option:selected" ),
@@ -115,10 +117,13 @@ return $.widget( "ui.selectmenu", {
.insertAfter( this.element );

this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
"ui-widget ui-state-default" );
"ui-button ui-widget" );

icon = $( "<span>" ).prependTo( this.button );
space = $( "<span> </span>" );
this._addClass( space, "ui-selectmenu-icon-space" );
this._addClass( icon, null, "ui-icon " + this.options.icons.button );
icon.after( space );

this.buttonItem = this._renderButtonItem( item )
.appendTo( this.button );
@@ -136,8 +141,6 @@ return $.widget( "ui.selectmenu", {
that._refreshMenu();
}
} );
this._hoverable( this.button );
this._focusable( this.button );
},

_drawMenu: function() {
@@ -606,7 +609,7 @@ return $.widget( "ui.selectmenu", {
// we always remove classes first and add them second, otherwise if both classes have the
// same theme class, it will be removed after we add it.
this._removeClass( this.button, "ui-selectmenu-button-" +
( this.isOpen ? "closed" : "open" ) )
( this.isOpen ? "closed" : "open" ) )
._addClass( this.button, "ui-selectmenu-button-" +
( this.isOpen ? "open" : "closed" ) )
._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
@@ -674,12 +677,13 @@ return $.widget( "ui.selectmenu", {
},

_destroy: function() {
this._unbindFormResetHandler();
this.menuWrap.remove();
this.button.remove();
this.element.show();
this.element.removeUniqueId();
this.labels.attr( "for", this.ids.element );
}
} );
} ] );

} ) );
@@ -12,9 +12,9 @@
//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
//>>docs: http://api.jqueryui.com/slider/
//>>demos: http://jqueryui.com/slider/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/slider.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/slider.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -12,7 +12,7 @@
//>>description: Enables items in a list to be sorted using the mouse.
//>>docs: http://api.jqueryui.com/sortable/
//>>demos: http://jqueryui.com/sortable/
//>>css.structure: ../themes/base/sortable.css
//>>css.structure: ../../themes/base/sortable.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -12,9 +12,9 @@
//>>description: Displays buttons to easily input numbers via the keyboard or mouse.
//>>docs: http://api.jqueryui.com/spinner/
//>>demos: http://jqueryui.com/spinner/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/spinner.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/spinner.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -230,12 +230,7 @@ $.widget( "ui.spinner", {

// Add buttons
.append(
"<a>" +
"<span>&#9650;</span>" +
"</a>" +
"<a>" +
"<span>&#9660;</span>" +
"</a>"
"<a></a><a></a>"
);
},

@@ -250,17 +245,26 @@ $.widget( "ui.spinner", {
// Button bindings
this.buttons = this.uiSpinner.children( "a" )
.attr( "tabIndex", -1 )
.button();
.attr( "aria-hidden", true )
.button( {
classes: {
"ui-button": ""
}
} );

// TODO: Right now button does not support classes this is already updated in button PR
this._removeClass( this.buttons, "ui-corner-all" );

this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" );
this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" );
this._addClass( this.buttons.first().find( ".ui-button-text span" ), null,
"ui-icon " + this.options.icons.up );
this._addClass( this.buttons.last().find( ".ui-button-text span" ), null,
"ui-icon " + this.options.icons.down );
this.buttons.first().button( {
"icon": this.options.icons.up,
"showLabel": false
} );
this.buttons.last().button( {
"icon": this.options.icons.down,
"showLabel": false
} );

// IE 6 doesn't understand height: 50% for the buttons
// unless the wrapper has an explicit height
@@ -559,13 +563,7 @@ if ( $.uiBackCompat !== false ) {
},

_buttonHtml: function() {
return "" +
"<a>" +
"<span>&#9650;</span>" +
"</a>" +
"<a>" +
"<span>&#9660;</span>" +
"</a>";
return "<a></a><a></a>";
}
} );
}
@@ -12,9 +12,9 @@
//>>description: Transforms a set of container elements into a tab structure.
//>>docs: http://api.jqueryui.com/tabs/
//>>demos: http://jqueryui.com/tabs/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/tabs.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/tabs.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -12,9 +12,9 @@
//>>description: Shows additional information for any element on hover or focus.
//>>docs: http://api.jqueryui.com/tooltip/
//>>demos: http://jqueryui.com/tooltip/
//>>css.structure: ../themes/base/core.css
//>>css.structure: ../themes/base/tooltip.css
//>>css.theme: ../themes/base/theme.css
//>>css.structure: ../../themes/base/core.css
//>>css.structure: ../../themes/base/tooltip.css
//>>css.theme: ../../themes/base/theme.css

( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@ -318,7 +318,8 @@ $.widget( "ui.tooltip", {
// Handle tracking tooltips that are shown with a delay (#8644). As soon
// as the tooltip is visible, position the tooltip using the most recent
// event.
if ( this.options.show && this.options.show.delay ) {
// Adds the check to add the timers only when both delay and track options are set (#14682)
if ( this.options.track && this.options.show && this.options.show.delay ) {
delayedShow = this.delayedShow = setInterval( function() {
if ( tooltip.is( ":visible" ) ) {
position( positionOption.of );