mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Merge branch 'master' into selectmenu
This commit is contained in:
commit
749c8fbb66
@ -18,13 +18,6 @@
|
||||
margin: .8em 0 .2em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.ui-autocomplete li.ui-autocomplete-category {
|
||||
font-size: 1em;
|
||||
line-height: 1.5;
|
||||
margin: 0.5em 0 0 0;
|
||||
height: auto;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$.widget( "custom.catcomplete", $.ui.autocomplete, {
|
||||
|
@ -32,7 +32,6 @@
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-fo.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-fr.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-ge.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-gl.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-he.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-hi.js"></script>
|
||||
@ -43,6 +42,7 @@
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-is.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-it.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-ja.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-ka.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-kk.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-km.js"></script>
|
||||
<script src="../../ui/i18n/jquery.ui.datepicker-ko.js"></script>
|
||||
|
@ -66,7 +66,6 @@
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-fo.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-fr.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-ge.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-gl.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-he.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-hi.js"></script>
|
||||
@ -77,6 +76,7 @@
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-is.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-it.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-ja.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-ka.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-kk.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-km.js"></script>
|
||||
<script src="../ui/i18n/jquery.ui.datepicker-ko.js"></script>
|
||||
|
@ -1,6 +1,6 @@
|
||||
(function( $ ) {
|
||||
|
||||
var equalHeights = TestHelpers.accordion.equalHeights,
|
||||
var equalHeight = TestHelpers.accordion.equalHeight,
|
||||
setupTeardown = TestHelpers.accordion.setupTeardown,
|
||||
state = TestHelpers.accordion.state;
|
||||
|
||||
@ -109,7 +109,7 @@ module( "accordion (deprecated) - height options", setupTeardown() );
|
||||
|
||||
test( "{ autoHeight: true }, default", function() {
|
||||
expect( 3 );
|
||||
equalHeights( $( "#navigation" ).accordion({ autoHeight: true }), 95, 130 );
|
||||
equalHeight( $( "#navigation" ).accordion({ autoHeight: true }), 105 );
|
||||
});
|
||||
|
||||
test( "{ autoHeight: false }", function() {
|
||||
@ -128,7 +128,7 @@ test( "{ fillSpace: true }", function() {
|
||||
expect( 3 );
|
||||
$( "#navigationWrapper" ).height( 500 );
|
||||
var element = $( "#navigation" ).accordion({ fillSpace: true });
|
||||
equalHeights( element, 446, 458 );
|
||||
equalHeight( element, 455 );
|
||||
});
|
||||
|
||||
test( "{ fillSapce: true } with sibling", function() {
|
||||
@ -142,7 +142,7 @@ test( "{ fillSapce: true } with sibling", function() {
|
||||
})
|
||||
.prependTo( "#navigationWrapper" );
|
||||
var element = $( "#navigation" ).accordion({ fillSpace: true });
|
||||
equalHeights( element , 346, 358);
|
||||
equalHeight( element , 355 );
|
||||
});
|
||||
|
||||
test( "{ fillSpace: true } with multiple siblings", function() {
|
||||
@ -171,7 +171,7 @@ test( "{ fillSpace: true } with multiple siblings", function() {
|
||||
})
|
||||
.prependTo( "#navigationWrapper" );
|
||||
var element = $( "#navigation" ).accordion({ fillSpace: true });
|
||||
equalHeights( element, 296, 308 );
|
||||
equalHeight( element, 305 );
|
||||
});
|
||||
|
||||
|
||||
@ -206,11 +206,11 @@ test( "resize", function() {
|
||||
.accordion({
|
||||
heightStyle: "fill"
|
||||
});
|
||||
equalHeights( element, 246, 258 );
|
||||
equalHeight( element, 255 );
|
||||
|
||||
element.parent().height( 500 );
|
||||
element.accordion( "resize" );
|
||||
equalHeights( element, 446, 458 );
|
||||
equalHeight( element, 455 );
|
||||
});
|
||||
|
||||
|
||||
|
@ -56,11 +56,11 @@ test( "beforeActivate", function() {
|
||||
element.one( "accordionbeforeactivate", function( event, ui ) {
|
||||
ok( !( "originalEvent" in event ) );
|
||||
equal( ui.oldHeader.length, 0 );
|
||||
equal( ui.oldContent.length, 0 );
|
||||
equal( ui.oldPanel.length, 0 );
|
||||
equal( ui.newHeader.length, 1 );
|
||||
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
|
||||
equal( ui.newContent.length, 1 );
|
||||
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
|
||||
equal( ui.newPanel.length, 1 );
|
||||
strictEqual( ui.newPanel[ 0 ], content[ 0 ] );
|
||||
state( element, 0, 0, 0 );
|
||||
});
|
||||
element.accordion( "option", "active", 0 );
|
||||
@ -70,12 +70,12 @@ test( "beforeActivate", function() {
|
||||
equal( event.originalEvent.type, "click" );
|
||||
equal( ui.oldHeader.length, 1 );
|
||||
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
|
||||
equal( ui.oldContent.length, 1 );
|
||||
strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
|
||||
equal( ui.oldPanel.length, 1 );
|
||||
strictEqual( ui.oldPanel[ 0 ], content[ 0 ] );
|
||||
equal( ui.newHeader.length, 1 );
|
||||
strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
|
||||
equal( ui.newContent.length, 1 );
|
||||
strictEqual( ui.newContent[ 0 ], content[ 1 ] );
|
||||
equal( ui.newPanel.length, 1 );
|
||||
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
|
||||
state( element, 1, 0, 0 );
|
||||
});
|
||||
headers.eq( 1 ).click();
|
||||
@ -85,10 +85,10 @@ test( "beforeActivate", function() {
|
||||
ok( !( "originalEvent" in event ) );
|
||||
equal( ui.oldHeader.length, 1 );
|
||||
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
|
||||
equal( ui.oldContent.length, 1 );
|
||||
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
|
||||
equal( ui.oldPanel.length, 1 );
|
||||
strictEqual( ui.oldPanel[ 0 ], content[ 1 ] );
|
||||
equal( ui.newHeader.length, 0 );
|
||||
equal( ui.newContent.length, 0 );
|
||||
equal( ui.newPanel.length, 0 );
|
||||
state( element, 0, 1, 0 );
|
||||
});
|
||||
element.accordion( "option", "active", false );
|
||||
@ -97,11 +97,11 @@ test( "beforeActivate", function() {
|
||||
element.one( "accordionbeforeactivate", function( event, ui ) {
|
||||
ok( !( "originalEvent" in event ) );
|
||||
equal( ui.oldHeader.length, 0 );
|
||||
equal( ui.oldContent.length, 0 );
|
||||
equal( ui.oldPanel.length, 0 );
|
||||
equal( ui.newHeader.length, 1 );
|
||||
strictEqual( ui.newHeader[ 0 ], headers[ 2 ] );
|
||||
equal( ui.newContent.length, 1 );
|
||||
strictEqual( ui.newContent[ 0 ], content[ 2 ] );
|
||||
equal( ui.newPanel.length, 1 );
|
||||
strictEqual( ui.newPanel[ 0 ], content[ 2 ] );
|
||||
event.preventDefault();
|
||||
state( element, 0, 0, 0 );
|
||||
});
|
||||
@ -120,33 +120,33 @@ test( "activate", function() {
|
||||
|
||||
element.one( "accordionactivate", function( event, ui ) {
|
||||
equal( ui.oldHeader.length, 0 );
|
||||
equal( ui.oldContent.length, 0 );
|
||||
equal( ui.oldPanel.length, 0 );
|
||||
equal( ui.newHeader.length, 1 );
|
||||
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
|
||||
equal( ui.newContent.length, 1 );
|
||||
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
|
||||
equal( ui.newPanel.length, 1 );
|
||||
strictEqual( ui.newPanel[ 0 ], content[ 0 ] );
|
||||
});
|
||||
element.accordion( "option", "active", 0 );
|
||||
|
||||
element.one( "accordionactivate", function( event, ui ) {
|
||||
equal( ui.oldHeader.length, 1 );
|
||||
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
|
||||
equal( ui.oldContent.length, 1 );
|
||||
strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
|
||||
equal( ui.oldPanel.length, 1 );
|
||||
strictEqual( ui.oldPanel[ 0 ], content[ 0 ] );
|
||||
equal( ui.newHeader.length, 1 );
|
||||
strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
|
||||
equal( ui.newContent.length, 1 );
|
||||
strictEqual( ui.newContent[ 0 ], content[ 1 ] );
|
||||
equal( ui.newPanel.length, 1 );
|
||||
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
|
||||
});
|
||||
headers.eq( 1 ).click();
|
||||
|
||||
element.one( "accordionactivate", function( event, ui ) {
|
||||
equal( ui.oldHeader.length, 1 );
|
||||
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
|
||||
equal( ui.oldContent.length, 1 );
|
||||
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
|
||||
equal( ui.oldPanel.length, 1 );
|
||||
strictEqual( ui.oldPanel[ 0 ], content[ 1 ] );
|
||||
equal( ui.newHeader.length, 0 );
|
||||
equal( ui.newContent.length, 0 );
|
||||
equal( ui.newPanel.length, 0 );
|
||||
});
|
||||
element.accordion( "option", "active", false );
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
(function( $ ) {
|
||||
|
||||
var equalHeights = TestHelpers.accordion.equalHeights,
|
||||
var equalHeight = TestHelpers.accordion.equalHeight,
|
||||
setupTeardown = TestHelpers.accordion.setupTeardown,
|
||||
state = TestHelpers.accordion.state;
|
||||
|
||||
@ -38,11 +38,11 @@ test( "refresh", function() {
|
||||
.accordion({
|
||||
heightStyle: "fill"
|
||||
});
|
||||
equalHeights( element, 246, 258 );
|
||||
equalHeight( element, 255 );
|
||||
|
||||
element.parent().height( 500 );
|
||||
element.accordion( "refresh" );
|
||||
equalHeights( element, 446, 458 );
|
||||
equalHeight( element, 455 );
|
||||
});
|
||||
|
||||
}( jQuery ) );
|
||||
|
@ -1,6 +1,6 @@
|
||||
(function( $ ) {
|
||||
|
||||
var equalHeights = TestHelpers.accordion.equalHeights,
|
||||
var equalHeight = TestHelpers.accordion.equalHeight,
|
||||
setupTeardown = TestHelpers.accordion.setupTeardown,
|
||||
state = TestHelpers.accordion.state;
|
||||
|
||||
@ -359,7 +359,7 @@ test( "{ header: custom }", function() {
|
||||
test( "{ heightStyle: 'auto' }", function() {
|
||||
expect( 3 );
|
||||
var element = $( "#navigation" ).accordion({ heightStyle: "auto" });
|
||||
equalHeights( element, 95, 130 );
|
||||
equalHeight( element, 105 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'content' }", function() {
|
||||
@ -368,16 +368,16 @@ test( "{ heightStyle: 'content' }", function() {
|
||||
sizes = element.find( ".ui-accordion-content" ).map(function() {
|
||||
return $( this ).height();
|
||||
}).get();
|
||||
ok( sizes[ 0 ] >= 70 && sizes[ 0 ] <= 105, "was " + sizes[ 0 ] );
|
||||
ok( sizes[ 1 ] >= 98 && sizes[ 1 ] <= 126, "was " + sizes[ 1 ] );
|
||||
ok( sizes[ 2 ] >= 42 && sizes[ 2 ] <= 54, "was " + sizes[ 2 ] );
|
||||
equal( sizes[ 0 ], 75 );
|
||||
equal( sizes[ 1 ], 105 );
|
||||
equal( sizes[ 2 ], 45 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'fill' }", function() {
|
||||
expect( 3 );
|
||||
$( "#navigationWrapper" ).height( 500 );
|
||||
var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
|
||||
equalHeights( element, 446, 458 );
|
||||
equalHeight( element, 455 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'fill' } with sibling", function() {
|
||||
@ -391,7 +391,7 @@ test( "{ heightStyle: 'fill' } with sibling", function() {
|
||||
})
|
||||
.prependTo( "#navigationWrapper" );
|
||||
var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
|
||||
equalHeights( element , 346, 358);
|
||||
equalHeight( element , 355 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'fill' } with multiple siblings", function() {
|
||||
@ -420,7 +420,7 @@ test( "{ heightStyle: 'fill' } with multiple siblings", function() {
|
||||
})
|
||||
.prependTo( "#navigationWrapper" );
|
||||
var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
|
||||
equalHeights( element, 296, 308 );
|
||||
equalHeight( element, 305 );
|
||||
});
|
||||
|
||||
test( "{ icons: false }", function() {
|
||||
|
@ -1,13 +1,8 @@
|
||||
TestHelpers.accordion = {
|
||||
equalHeights: function( accordion, min, max ) {
|
||||
var sizes = [];
|
||||
equalHeight: function( accordion, height ) {
|
||||
accordion.find( ".ui-accordion-content" ).each(function() {
|
||||
sizes.push( $( this ).outerHeight() );
|
||||
equal( $( this ).outerHeight(), height );
|
||||
});
|
||||
ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
|
||||
"must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
|
||||
deepEqual( sizes[ 0 ], sizes[ 1 ] );
|
||||
deepEqual( sizes[ 0 ], sizes[ 2 ] );
|
||||
},
|
||||
|
||||
setupTeardown: function() {
|
||||
|
@ -153,4 +153,14 @@ test( "outerHeight(true) - setter", function() {
|
||||
equal( el.height(), 32, "height set properly when hidden" );
|
||||
});
|
||||
|
||||
test( "uniqueId / removeUniqueId", function() {
|
||||
var el = $( "img" ).eq( 0 );
|
||||
|
||||
equal( el.attr( "id" ), undefined, "element has no initial id" );
|
||||
el.uniqueId();
|
||||
ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" );
|
||||
el.removeUniqueId();
|
||||
equal( el.attr( "id" ), undefined, "unique id has been removed from element" );
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
|
@ -89,26 +89,11 @@ function margin(el, side) {
|
||||
module("dialog: core");
|
||||
|
||||
test("title id", function() {
|
||||
expect(3);
|
||||
|
||||
var titleId;
|
||||
|
||||
// reset the uuid so we know what values to expect
|
||||
$.ui.dialog.uuid = 0;
|
||||
expect(1);
|
||||
|
||||
el = $('<div></div>').dialog();
|
||||
titleId = dlg().find('.ui-dialog-title').attr('id');
|
||||
equal(titleId, 'ui-dialog-title-1', 'auto-numbered title id');
|
||||
el.remove();
|
||||
|
||||
el = $('<div></div>').dialog();
|
||||
titleId = dlg().find('.ui-dialog-title').attr('id');
|
||||
equal(titleId, 'ui-dialog-title-2', 'auto-numbered title id');
|
||||
el.remove();
|
||||
|
||||
el = $('<div id="foo">').dialog();
|
||||
titleId = dlg().find('.ui-dialog-title').attr('id');
|
||||
equal(titleId, 'ui-dialog-title-foo', 'carried over title id');
|
||||
var titleId = dlg().find('.ui-dialog-title').attr('id');
|
||||
ok( /ui-id-\d+$/.test( titleId ), 'auto-numbered title id');
|
||||
el.remove();
|
||||
});
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
||||
<li class="foo"><a class="foo" href="#">Aberdeen</a></li>
|
||||
<li class="foo"><a class="foo" href="#">Ada</a></li>
|
||||
<li class="foo"><a class="foo" href="#">Adamsville</a></li>
|
||||
<li class="foo"><a class="foo" href="#">Addyston</a></li>
|
||||
<li class="foo"><a id="testID1" class="foo" href="#">Addyston</a></li>
|
||||
<li class="foo"><a class="foo" href="#">Adelphi</a></li>
|
||||
</ul>
|
||||
|
||||
@ -88,8 +88,11 @@
|
||||
<a href="#">Delphi</a>
|
||||
<ul>
|
||||
<li class="foo"><a class="foo" href="#">Ada</a></li>
|
||||
<li> - </li>
|
||||
<li class="foo"><a class="foo" href="#">Saarland</a></li>
|
||||
<li></li>
|
||||
<li class="foo"><a class="foo" href="#">Salzburg</a></li>
|
||||
<li>–</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="foo"><a class="foo" href="#">Perch</a></li>
|
||||
@ -232,7 +235,7 @@
|
||||
<a href="#">Delphi</a>
|
||||
<div>
|
||||
<blockquote><a href="#">Ada</a></blockquote>
|
||||
<blockquote><a href="#">Saarland</a></blockquote>
|
||||
<blockquote><a id="testID2" href="#">Saarland</a></blockquote>
|
||||
<blockquote><a href="#">Salzburg</a></blockquote>
|
||||
</div>
|
||||
</blockquote>
|
||||
@ -255,7 +258,7 @@
|
||||
<li class="foo"><a class="foo" href="#">Adamsville</a></li>
|
||||
<li class="foo"><a class="foo" href="#">Addyston</a></li>
|
||||
<li class="ui-state-disabled">
|
||||
<a href="#">Delphi</a>
|
||||
<a id="testID3" href="#">Delphi</a>
|
||||
<ul>
|
||||
<li class="foo"><a class="foo" href="#">Ada</a></li>
|
||||
<li class="foo"><a class="foo" href="#">Saarland</a></li>
|
||||
|
@ -23,7 +23,7 @@ test("accessibility", function () {
|
||||
|
||||
item = menu.find( "li:last" );
|
||||
menu.menu( "focus", $.Event(), item );
|
||||
equal( menu.attr("aria-activedescendant"), "menu1-4", "aria attribute, generated id");
|
||||
ok( /^ui-id-\d+$/.test( menu.attr( "aria-activedescendant" ) ), "aria attribute, generated id");
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -315,16 +315,27 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
|
||||
equal( $("#log").html(), "4,keydown,", "Keydown ESCAPE (close submenu)");
|
||||
|
||||
log("keydown",true);
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
|
||||
setTimeout( menukeyboard5, 50 );
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
|
||||
setTimeout( function() {
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
|
||||
setTimeout( function() {
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
|
||||
equal( $("#log").html(), "0,4,2,0,1,0,6,5,keydown,", "Keydown skip dividers and items without anchors");
|
||||
|
||||
log("keydown",true);
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
|
||||
setTimeout( menukeyboard6, 50 );
|
||||
}, 50 );
|
||||
}, 50 );
|
||||
}
|
||||
|
||||
function menukeyboard5() {
|
||||
equal( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
|
||||
|
||||
log("keydown",true);
|
||||
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
|
||||
equal( $("#log").html(), "Ada,keydown,", "Keydown ENTER (select item)");
|
||||
function menukeyboard6() {
|
||||
equal( $("#log").html(), "Ada,keydown,", "Keydown ENTER (open submenu)");
|
||||
|
||||
start();
|
||||
}
|
||||
|
@ -29,13 +29,17 @@ test( "enable/disable", function() {
|
||||
});
|
||||
|
||||
test( "refresh", function() {
|
||||
expect( 3 );
|
||||
expect( 5 );
|
||||
var menu = $( "#menu1" ).menu();
|
||||
equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
|
||||
menu.append("<li><a href='#'>test item</a></li>").menu("refresh");
|
||||
equal(menu.find(".ui-menu-item").length,6,"Incorrect number of menu items");
|
||||
menu.find(".ui-menu-item:last").remove().end().menu("refresh");
|
||||
equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
|
||||
menu.append("<li>---</li>").menu("refresh");
|
||||
equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
|
||||
menu.children(":last").remove().end().menu("refresh");
|
||||
equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
|
||||
});
|
||||
|
||||
test("destroy", function() {
|
||||
|
@ -1,28 +1,20 @@
|
||||
/*
|
||||
* progressbar_core.js
|
||||
*/
|
||||
module( "progressbar: core" );
|
||||
|
||||
var el;
|
||||
test( "accessibility", function() {
|
||||
expect( 7 );
|
||||
var element = $( "#progressbar" ).progressbar();
|
||||
|
||||
(function($) {
|
||||
equal( element.attr( "role" ), "progressbar", "aria role" );
|
||||
equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
|
||||
equal( element.attr( "aria-valuemax" ), 100, "aria-valuemax" );
|
||||
equal( element.attr( "aria-valuenow" ), 0, "aria-valuenow initially" );
|
||||
|
||||
module("progressbar: core");
|
||||
element.progressbar( "value", 77 );
|
||||
equal( element.attr( "aria-valuenow" ), 77, "aria-valuenow" );
|
||||
|
||||
test("accessibility", function() {
|
||||
expect(7);
|
||||
el = $("#progressbar").progressbar();
|
||||
element.progressbar( "disable" );
|
||||
equal( element.attr( "aria-disabled" ), "true", "aria-disabled on" );
|
||||
|
||||
equal(el.attr("role"), "progressbar", "aria role");
|
||||
equal(el.attr("aria-valuemin"), 0, "aria-valuemin");
|
||||
equal(el.attr("aria-valuemax"), 100, "aria-valuemax");
|
||||
equal(el.attr("aria-valuenow"), 0, "aria-valuenow initially");
|
||||
el.progressbar("value", 77);
|
||||
equal(el.attr("aria-valuenow"), 77, "aria-valuenow");
|
||||
el.progressbar("disable");
|
||||
equal(el.attr("aria-disabled"), "true", "aria-disabled on");
|
||||
el.progressbar("enable");
|
||||
// FAIL: for some reason IE6 and 7 return a boolean false instead of the string
|
||||
equal(el.attr("aria-disabled"), "false", "aria-disabled off");
|
||||
element.progressbar( "enable" );
|
||||
equal( element.attr( "aria-disabled" ), "false", "aria-disabled off" );
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -1,51 +1,43 @@
|
||||
/*
|
||||
* progressbar_events.js
|
||||
*/
|
||||
(function($) {
|
||||
module( "progressbar: events" );
|
||||
|
||||
module("progressbar: events");
|
||||
|
||||
test("create", function() {
|
||||
expect(1);
|
||||
$("#progressbar").progressbar({
|
||||
test( "create", function() {
|
||||
expect( 1 );
|
||||
$( "#progressbar" ).progressbar({
|
||||
value: 5,
|
||||
create: function() {
|
||||
deepEqual(5, $(this).progressbar("value") );
|
||||
deepEqual( 5, $( this ).progressbar( "value" ) );
|
||||
},
|
||||
change: function() {
|
||||
ok(false, 'create() has triggered change()');
|
||||
ok( false, "create() has triggered change()" );
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test("change", function() {
|
||||
expect(1);
|
||||
$("#progressbar").progressbar({
|
||||
test( "change", function() {
|
||||
expect( 1 );
|
||||
$( "#progressbar" ).progressbar({
|
||||
change: function() {
|
||||
deepEqual( 5, $(this).progressbar("value") );
|
||||
deepEqual( 5, $( this ).progressbar( "value" ) );
|
||||
}
|
||||
}).progressbar("value", 5);
|
||||
}).progressbar( "value", 5 );
|
||||
});
|
||||
|
||||
test( "complete", function() {
|
||||
expect( 3 );
|
||||
var changes = 0,
|
||||
value;
|
||||
|
||||
$( "#progressbar" ).progressbar({
|
||||
change: function() {
|
||||
changes++;
|
||||
deepEqual( $( this ).progressbar( "value" ), value, "change at " + value );
|
||||
},
|
||||
complete: function() {
|
||||
equal( changes, 2, "complete triggered after change" );
|
||||
}
|
||||
});
|
||||
var value,
|
||||
changes = 0,
|
||||
element = $( "#progressbar" ).progressbar({
|
||||
change: function() {
|
||||
changes++;
|
||||
deepEqual( element.progressbar( "value" ), value, "change at " + value );
|
||||
},
|
||||
complete: function() {
|
||||
equal( changes, 2, "complete triggered after change" );
|
||||
}
|
||||
});
|
||||
|
||||
value = 5;
|
||||
$( "#progressbar" ).progressbar( "value", value );
|
||||
element.progressbar( "value", value );
|
||||
value = 100;
|
||||
$( "#progressbar" ).progressbar( "value", value );
|
||||
element.progressbar( "value", value );
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -1,36 +1,17 @@
|
||||
/*
|
||||
* progressbar_methods.js
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
module("progressbar: methods");
|
||||
|
||||
test("init", function() {
|
||||
expect(1);
|
||||
|
||||
$("<div></div>").appendTo('body').progressbar().remove();
|
||||
ok(true, '.progressbar() called on element');
|
||||
module( "progressbar: methods" );
|
||||
|
||||
test( "destroy", function() {
|
||||
expect( 1 );
|
||||
domEqual( "#progressbar", function() {
|
||||
$( "#progressbar" ).progressbar().progressbar( "destroy" );
|
||||
});
|
||||
});
|
||||
|
||||
test("destroy", function() {
|
||||
expect(2);
|
||||
test( "value", function() {
|
||||
expect( 3 );
|
||||
|
||||
$("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove();
|
||||
ok(true, '.progressbar("destroy") called on element');
|
||||
|
||||
var expected = $('<div></div>').progressbar(),
|
||||
actual = expected.progressbar('destroy');
|
||||
equal(actual, expected, 'destroy is chainable');
|
||||
var element = $( "<div>" ).progressbar({ value: 20 });
|
||||
equal( element.progressbar( "value" ), 20, "correct value as getter" );
|
||||
equal( element.progressbar( "value", 30), element, "chainable as setter" );
|
||||
equal( element.progressbar( "option", "value" ), 30, "correct value after setter" );
|
||||
});
|
||||
|
||||
test('value', function() {
|
||||
expect(3);
|
||||
|
||||
var el = $('<div></div>').progressbar({ value: 20 });
|
||||
equal(el.progressbar('value'), 20, 'correct value as getter');
|
||||
equal(el.progressbar('value', 30), el, 'chainable as setter');
|
||||
equal(el.progressbar('option', 'value'), 30, 'correct value after setter');
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -1,13 +1,8 @@
|
||||
/*
|
||||
* progressbar_options.js
|
||||
*/
|
||||
(function($) {
|
||||
module( "progressbar: options" );
|
||||
|
||||
module("progressbar: options");
|
||||
|
||||
test("{ value : 0 }, default", function() {
|
||||
$("#progressbar").progressbar();
|
||||
deepEqual( 0, $("#progressbar").progressbar("value") );
|
||||
test( "{ value : 0 }, default", function() {
|
||||
$( "#progressbar" ).progressbar();
|
||||
equal( 0, $( "#progressbar" ).progressbar( "value" ) );
|
||||
});
|
||||
|
||||
// Ticket #7231 - valueDiv should be hidden when value is at 0%
|
||||
@ -16,44 +11,47 @@ test( "value: visibility of valueDiv", function() {
|
||||
var element = $( "#progressbar" ).progressbar({
|
||||
value: 0
|
||||
});
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is initialized at 0" );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ),
|
||||
"valueDiv hidden when value is initialized at 0" );
|
||||
element.progressbar( "value", 1 );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 1" );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":visible" ),
|
||||
"valueDiv visible when value is set to 1" );
|
||||
element.progressbar( "value", 100 );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 100" );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":visible" ),
|
||||
"valueDiv visible when value is set to 100" );
|
||||
element.progressbar( "value", 0 );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is set to 0" );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ),
|
||||
"valueDiv hidden when value is set to 0" );
|
||||
element.progressbar( "value", -1 );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value set to -1 (normalizes to 0)" );
|
||||
ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ),
|
||||
"valueDiv hidden when value set to -1 (normalizes to 0)" );
|
||||
});
|
||||
|
||||
test("{ value : 5 }", function() {
|
||||
$("#progressbar").progressbar({
|
||||
test( "{ value : 5 }", function() {
|
||||
$( "#progressbar" ).progressbar({
|
||||
value: 5
|
||||
});
|
||||
deepEqual( 5, $("#progressbar").progressbar("value") );
|
||||
equal( 5, $( "#progressbar" ).progressbar( "value" ) );
|
||||
});
|
||||
|
||||
test("{ value : -5 }", function() {
|
||||
$("#progressbar").progressbar({
|
||||
test( "{ value : -5 }", function() {
|
||||
$( "#progressbar" ).progressbar({
|
||||
value: -5
|
||||
});
|
||||
deepEqual( 0, $("#progressbar").progressbar("value") );
|
||||
deepEqual( 0, $( "#progressbar" ).progressbar( "value" ) );
|
||||
});
|
||||
|
||||
test("{ value : 105 }", function() {
|
||||
$("#progressbar").progressbar({
|
||||
test( "{ value : 105 }", function() {
|
||||
$( "#progressbar" ).progressbar({
|
||||
value: 105
|
||||
});
|
||||
deepEqual( 100, $("#progressbar").progressbar("value") );
|
||||
deepEqual( 100, $( "#progressbar" ).progressbar( "value" ) );
|
||||
});
|
||||
|
||||
test("{ max : 5, value : 10 }", function() {
|
||||
test( "{ max : 5, value : 10 }", function() {
|
||||
$("#progressbar").progressbar({
|
||||
max: 5,
|
||||
value: 10
|
||||
});
|
||||
deepEqual( 5, $("#progressbar").progressbar("value") );
|
||||
deepEqual( 5, $( "#progressbar" ).progressbar( "value" ) );
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -31,6 +31,14 @@
|
||||
<script src="tabs_options.js"></script>
|
||||
|
||||
<script src="../swarminject.js"></script>
|
||||
<style>
|
||||
#tabs8, #tabs8 * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 12px;
|
||||
line-height: 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -120,6 +128,23 @@
|
||||
<div id="tabs7-1"></div>
|
||||
</div>
|
||||
|
||||
<div id="tabs8Wrapper">
|
||||
<div id="tabs8">
|
||||
<ul id="tabs8-list">
|
||||
<li><a href="#tabs8-1">1</a></li>
|
||||
<li><a href="#tabs8-2">2</a></li>
|
||||
</ul>
|
||||
<div id="tabs8-1">
|
||||
<p>Lorem ipsum</p>
|
||||
<p>Lorem ipsum</p>
|
||||
<p>Lorem ipsum</p>
|
||||
</div>
|
||||
<div id="tabs8-2">
|
||||
<p>Lorem ipsum</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -4,6 +4,7 @@ TestHelpers.commonWidgetTests( "tabs", {
|
||||
collapsible: false,
|
||||
disabled: false,
|
||||
event: "click",
|
||||
heightStyle: "content",
|
||||
hide: null,
|
||||
show: null,
|
||||
|
||||
|
@ -7,6 +7,7 @@ TestHelpers.commonWidgetTests( "tabs", {
|
||||
cookie: null,
|
||||
disabled: false,
|
||||
event: "click",
|
||||
heightStyle: "content",
|
||||
hide: null,
|
||||
fx: null,
|
||||
idPrefix: "ui-tabs-",
|
||||
|
@ -30,6 +30,14 @@
|
||||
<script src="tabs_deprecated.js"></script>
|
||||
|
||||
<script src="../swarminject.js"></script>
|
||||
<style>
|
||||
#tabs8, #tabs8 * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 12px;
|
||||
line-height: 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -119,6 +127,23 @@
|
||||
<div id="tabs7-1"></div>
|
||||
</div>
|
||||
|
||||
<div id="tabs8Wrapper">
|
||||
<div id="tabs8">
|
||||
<ul id="tabs8-list">
|
||||
<li><a href="#tabs8-1">1</a></li>
|
||||
<li><a href="#tabs8-2">2</a></li>
|
||||
</ul>
|
||||
<div id="tabs8-1">
|
||||
<p>Lorem ipsum</p>
|
||||
<p>Lorem ipsum</p>
|
||||
<p>Lorem ipsum</p>
|
||||
</div>
|
||||
<div id="tabs8-2">
|
||||
<p>Lorem ipsum</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,6 +1,7 @@
|
||||
(function( $ ) {
|
||||
|
||||
var disabled = TestHelpers.tabs.disabled,
|
||||
equalHeight = TestHelpers.tabs.equalHeight,
|
||||
state = TestHelpers.tabs.state;
|
||||
|
||||
module( "tabs: options" );
|
||||
@ -211,6 +212,72 @@ test( "{ event: custom }", function() {
|
||||
state( element, 0, 1, 0 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'auto' }", function() {
|
||||
expect( 2 );
|
||||
var element = $( "#tabs8" ).tabs({ heightStyle: "auto" });
|
||||
equalHeight( element, 45 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'content' }", function() {
|
||||
expect( 2 );
|
||||
var element = $( "#tabs8" ).tabs({ heightStyle: "content" }),
|
||||
sizes = element.find( ".ui-tabs-panel" ).map(function() {
|
||||
return $( this ).height();
|
||||
}).get();
|
||||
equal( sizes[ 0 ], 45 );
|
||||
equal( sizes[ 1 ], 15 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'fill' }", function() {
|
||||
expect( 2 );
|
||||
$( "#tabs8Wrapper" ).height( 500 );
|
||||
var element = $( "#tabs8" ).tabs({ heightStyle: "fill" });
|
||||
equalHeight( element, 485 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'fill' } with sibling", function() {
|
||||
expect( 2 );
|
||||
$( "#tabs8Wrapper" ).height( 500 );
|
||||
$( "<p>Lorem Ipsum</p>" )
|
||||
.css({
|
||||
height: 50,
|
||||
marginTop: 20,
|
||||
marginBottom: 30
|
||||
})
|
||||
.prependTo( "#tabs8Wrapper" );
|
||||
var element = $( "#tabs8" ).tabs({ heightStyle: "fill" });
|
||||
equalHeight( element, 385 );
|
||||
});
|
||||
|
||||
test( "{ heightStyle: 'fill' } with multiple siblings", function() {
|
||||
expect( 2 );
|
||||
$( "#tabs8Wrapper" ).height( 500 );
|
||||
$( "<p>Lorem Ipsum</p>" )
|
||||
.css({
|
||||
height: 50,
|
||||
marginTop: 20,
|
||||
marginBottom: 30
|
||||
})
|
||||
.prependTo( "#tabs8Wrapper" );
|
||||
$( "<p>Lorem Ipsum</p>" )
|
||||
.css({
|
||||
height: 50,
|
||||
marginTop: 20,
|
||||
marginBottom: 30,
|
||||
position: "absolute"
|
||||
})
|
||||
.prependTo( "#tabs8Wrapper" );
|
||||
$( "<p>Lorem Ipsum</p>" )
|
||||
.css({
|
||||
height: 25,
|
||||
marginTop: 10,
|
||||
marginBottom: 15
|
||||
})
|
||||
.prependTo( "#tabs8Wrapper" );
|
||||
var element = $( "#tabs8" ).tabs({ heightStyle: "fill" });
|
||||
equalHeight( element, 335 );
|
||||
});
|
||||
|
||||
// TODO: add animation tests
|
||||
|
||||
}( jQuery ) );
|
||||
|
@ -38,6 +38,12 @@ TestHelpers.tabs = {
|
||||
deepEqual( actual, expected );
|
||||
},
|
||||
|
||||
equalHeight: function( tabs, height ) {
|
||||
tabs.find( ".ui-tabs-panel" ).each(function() {
|
||||
equal( $( this ).outerHeight(), height );
|
||||
});
|
||||
},
|
||||
|
||||
state: function( tabs ) {
|
||||
var expected = $.makeArray( arguments ).slice( 1 ),
|
||||
actual = tabs.find( ".ui-tabs-nav li" ).map(function() {
|
||||
|
@ -138,32 +138,63 @@ TestHelpers.commonWidgetTests = function( widget, settings ) {
|
||||
/*
|
||||
* Experimental assertion for comparing DOM objects.
|
||||
*
|
||||
* Serializes an element and some attributes and it's children if any, otherwise the text.
|
||||
* Serializes an element and some properties and attributes and it's children if any, otherwise the text.
|
||||
* Then compares the result using deepEqual.
|
||||
*/
|
||||
window.domEqual = function( selector, modifier, message ) {
|
||||
var expected, actual,
|
||||
attributes = ["class", "role", "id", "tabIndex", "aria-activedescendant"];
|
||||
properties = [
|
||||
"disabled",
|
||||
"readOnly"
|
||||
],
|
||||
attributes = [
|
||||
"autocomplete",
|
||||
"aria-activedescendant",
|
||||
"aria-controls",
|
||||
"aria-describedby",
|
||||
"aria-disabled",
|
||||
"aria-expanded",
|
||||
"aria-haspopup",
|
||||
"aria-hidden",
|
||||
"aria-labelledby",
|
||||
"aria-pressed",
|
||||
"aria-selected",
|
||||
"aria-valuemax",
|
||||
"aria-valuemin",
|
||||
"aria-valuenow",
|
||||
"class",
|
||||
"href",
|
||||
"id",
|
||||
"nodeName",
|
||||
"role",
|
||||
"tabIndex",
|
||||
"title"
|
||||
];
|
||||
|
||||
function extract(value) {
|
||||
if (!value || !value.length) {
|
||||
QUnit.push( false, actual, expected, "domEqual failed, can't extract " + selector + ", message was: " + message );
|
||||
function extract( elem ) {
|
||||
if ( !elem || !elem.length ) {
|
||||
QUnit.push( false, actual, expected,
|
||||
"domEqual failed, can't extract " + selector + ", message was: " + message );
|
||||
return;
|
||||
}
|
||||
|
||||
var children,
|
||||
result = {};
|
||||
result.nodeName = value[0].nodeName;
|
||||
$.each(attributes, function(index, attr) {
|
||||
result[attr] = value.prop(attr);
|
||||
$.each( properties, function( index, attr ) {
|
||||
var value = elem.prop( attr );
|
||||
result[ attr ] = value !== undefined ? value : "";
|
||||
});
|
||||
result.children = [];
|
||||
children = value.children();
|
||||
if (children.length) {
|
||||
children.each(function() {
|
||||
result.children.push(extract($(this)));
|
||||
});
|
||||
$.each( attributes, function( index, attr ) {
|
||||
var value = elem.attr( attr );
|
||||
result[ attr ] = value !== undefined ? value : "";
|
||||
});
|
||||
children = elem.children();
|
||||
if ( children.length ) {
|
||||
result.children = elem.children().map(function( ind ) {
|
||||
return extract( $( this ) );
|
||||
}).get();
|
||||
} else {
|
||||
result.text = value.text();
|
||||
result.text = elem.text();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
$( "<p>" ).text( "Selected: " + ui.item.text() ).appendTo( "#log" );
|
||||
}
|
||||
|
||||
$( "#menu1, #menu2, #menu3, .menu4" ).menu({
|
||||
$( "#menu1, #menu2, #menu3, .menu4, #menu7" ).menu({
|
||||
select: logger
|
||||
});
|
||||
|
||||
@ -58,7 +58,6 @@
|
||||
<li><a href="#">Ada</a></li>
|
||||
<li><a href="#">Adamsville</a></li>
|
||||
<li><a href="#">Addyston</a></li>
|
||||
<li></li>
|
||||
<li>
|
||||
<a href="#">Delphi</a>
|
||||
<ul>
|
||||
@ -257,6 +256,54 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Inline with dividers and elements without anchors</h2>
|
||||
<ul id="menu7">
|
||||
<li><strong>Group 1</strong></li>
|
||||
<li><a href="#">Aberdeen</a></li>
|
||||
<li><a href="#">Ada</a></li>
|
||||
<li><a href="#">Adamsville</a></li>
|
||||
<li><a href="#">Addyston</a></li>
|
||||
<li></li>
|
||||
<li><strong>Group 2</strong></li>
|
||||
<li>
|
||||
<a href="#">Delphi</a>
|
||||
<ul>
|
||||
<li><a href="#">Ada</a></li>
|
||||
<li><a href="#">Saarland</a></li>
|
||||
<li><a href="#">Salzburg</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#">Saarland</a></li>
|
||||
<li>---</li>
|
||||
<li><strong>Group 3</strong></li>
|
||||
<li>
|
||||
<a href="#">Salzburg</a>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#">Delphi</a>
|
||||
<ul>
|
||||
<li><a href="#">Ada</a></li>
|
||||
<li> - </li>
|
||||
<li><a href="#">Saarland</a></li>
|
||||
<li>—</li>
|
||||
<li><a href="#">Salzburg</a></li>
|
||||
<li>–</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">Delphi</a>
|
||||
<ul>
|
||||
<li><a href="#">Ada</a></li>
|
||||
<li><a href="#">Saarland</a></li>
|
||||
<li><a href="#">Salzburg</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#">Perch</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#">Amesville</a></li>
|
||||
</ul>
|
||||
|
||||
<div style="position: absolute; top: 1em; right: 1em;">
|
||||
Log:
|
||||
<div id="log" style="height: 400px; width: 300px; overflow: auto; border: 1px solid #000;"></div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Lado Lomidze (lado.lomidze@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['ge'] = {
|
||||
$.datepicker.regional['ka'] = {
|
||||
closeText: 'დახურვა',
|
||||
prevText: '< წინა',
|
||||
nextText: 'შემდეგი >',
|
||||
@ -17,5 +17,5 @@ jQuery(function($){
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['ge']);
|
||||
$.datepicker.setDefaults($.datepicker.regional['ka']);
|
||||
});
|
49
ui/jquery.ui.accordion.js
vendored
49
ui/jquery.ui.accordion.js
vendored
@ -389,9 +389,9 @@ $.widget( "ui.accordion", {
|
||||
toHide = active.next(),
|
||||
eventData = {
|
||||
oldHeader: active,
|
||||
oldContent: toHide,
|
||||
oldPanel: toHide,
|
||||
newHeader: collapsing ? $() : clicked,
|
||||
newContent: toShow
|
||||
newPanel: toShow
|
||||
};
|
||||
|
||||
event.preventDefault();
|
||||
@ -437,8 +437,8 @@ $.widget( "ui.accordion", {
|
||||
},
|
||||
|
||||
_toggle: function( data ) {
|
||||
var toShow = data.newContent,
|
||||
toHide = this.prevShow.length ? this.prevShow : data.oldContent;
|
||||
var toShow = data.newPanel,
|
||||
toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
|
||||
|
||||
// handle activating a panel during the animation for another activation
|
||||
this.prevShow.add( this.prevHide ).stop( true, true );
|
||||
@ -453,16 +453,23 @@ $.widget( "ui.accordion", {
|
||||
this._toggleComplete( data );
|
||||
}
|
||||
|
||||
toHide
|
||||
.attr({
|
||||
"aria-expanded": "false",
|
||||
"aria-hidden": "true"
|
||||
toHide.attr({
|
||||
"aria-expanded": "false",
|
||||
"aria-hidden": "true"
|
||||
});
|
||||
toHide.prev().attr( "aria-selected", "false" );
|
||||
// if we're switching panels, remove the old header from the tab order
|
||||
// if we're opening from collapsed state, remove the previous header from the tab order
|
||||
// if we're collapsing, then keep the collapsing header in the tab order
|
||||
if ( toShow.length && toHide.length ) {
|
||||
toHide.prev().attr( "tabIndex", -1 );
|
||||
} else if ( toShow.length ) {
|
||||
this.headers.filter(function() {
|
||||
return $( this ).attr( "tabIndex" ) === 0;
|
||||
})
|
||||
.prev()
|
||||
.attr({
|
||||
"aria-selected": "false",
|
||||
tabIndex: -1
|
||||
});
|
||||
.attr( "tabIndex", -1 );
|
||||
}
|
||||
|
||||
toShow
|
||||
.attr({
|
||||
"aria-expanded": "true",
|
||||
@ -517,7 +524,7 @@ $.widget( "ui.accordion", {
|
||||
},
|
||||
|
||||
_toggleComplete: function( data ) {
|
||||
var toHide = data.oldContent;
|
||||
var toHide = data.oldPanel;
|
||||
|
||||
toHide
|
||||
.removeClass( "ui-accordion-content-active" )
|
||||
@ -669,9 +676,19 @@ if ( $.uiBackCompat !== false ) {
|
||||
}
|
||||
|
||||
if ( type === "beforeActivate" ) {
|
||||
ret = _trigger.call( this, "changestart", event, data );
|
||||
ret = _trigger.call( this, "changestart", event, {
|
||||
oldHeader: data.oldHeader,
|
||||
oldContent: data.oldPanel,
|
||||
newHeader: data.newHeader,
|
||||
newContent: data.newPanel
|
||||
});
|
||||
} else if ( type === "activate" ) {
|
||||
ret = _trigger.call( this, "change", event, data );
|
||||
ret = _trigger.call( this, "change", event, {
|
||||
oldHeader: data.oldHeader,
|
||||
oldContent: data.oldPanel,
|
||||
newHeader: data.newHeader,
|
||||
newContent: data.newPanel
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
1
ui/jquery.ui.autocomplete.js
vendored
1
ui/jquery.ui.autocomplete.js
vendored
@ -429,7 +429,6 @@ $.widget( "ui.autocomplete", {
|
||||
},
|
||||
|
||||
_close: function( event ) {
|
||||
clearTimeout( this.closing );
|
||||
if ( this.menu.element.is( ":visible" ) ) {
|
||||
this.menu.element.hide();
|
||||
this.menu.blur();
|
||||
|
19
ui/jquery.ui.core.js
vendored
19
ui/jquery.ui.core.js
vendored
@ -9,6 +9,9 @@
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
var uuid = 0,
|
||||
runiqueId = /^ui-id-\d+$/;
|
||||
|
||||
// prevent duplicate loading
|
||||
// this is only a problem because we proxy existing functions
|
||||
// and we don't want to double proxy them
|
||||
@ -107,6 +110,22 @@ $.fn.extend({
|
||||
return 0;
|
||||
},
|
||||
|
||||
uniqueId: function() {
|
||||
return this.each(function() {
|
||||
if ( !this.id ) {
|
||||
this.id = "ui-id-" + (++uuid);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
removeUniqueId: function() {
|
||||
return this.each(function() {
|
||||
if ( runiqueId.test( this.id ) ) {
|
||||
$( this ).removeAttr( "id" );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
disableSelection: function() {
|
||||
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
|
||||
".ui-disableSelection", function( event ) {
|
||||
|
12
ui/jquery.ui.dialog.js
vendored
12
ui/jquery.ui.dialog.js
vendored
@ -87,7 +87,6 @@ $.widget("ui.dialog", {
|
||||
options = this.options,
|
||||
|
||||
title = options.title || " ",
|
||||
titleId = $.ui.dialog.getTitleId( this.element ),
|
||||
|
||||
uiDialog = ( this.uiDialog = $( "<div>" ) )
|
||||
.addClass( uiDialogClasses + options.dialogClass )
|
||||
@ -105,10 +104,6 @@ $.widget("ui.dialog", {
|
||||
event.preventDefault();
|
||||
}
|
||||
})
|
||||
.attr({
|
||||
role: "dialog",
|
||||
"aria-labelledby": titleId
|
||||
})
|
||||
.mousedown(function( event ) {
|
||||
that.moveToTop( false, event );
|
||||
})
|
||||
@ -140,8 +135,8 @@ $.widget("ui.dialog", {
|
||||
.appendTo( uiDialogTitlebarClose ),
|
||||
|
||||
uiDialogTitle = $( "<span>" )
|
||||
.uniqueId()
|
||||
.addClass( "ui-dialog-title" )
|
||||
.attr( "id", titleId )
|
||||
.html( title )
|
||||
.prependTo( uiDialogTitlebar ),
|
||||
|
||||
@ -152,6 +147,11 @@ $.widget("ui.dialog", {
|
||||
.addClass( "ui-dialog-buttonset" )
|
||||
.appendTo( uiDialogButtonPane );
|
||||
|
||||
uiDialog.attr({
|
||||
role: "dialog",
|
||||
"aria-labelledby": uiDialogTitle.attr( "id" )
|
||||
});
|
||||
|
||||
uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection();
|
||||
this._hoverable( uiDialogTitlebarClose );
|
||||
this._focusable( uiDialogTitlebarClose );
|
||||
|
16
ui/jquery.ui.draggable.js
vendored
16
ui/jquery.ui.draggable.js
vendored
@ -55,17 +55,9 @@ $.widget("ui.draggable", $.ui.mouse, {
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if(!this.element.data('draggable')) return;
|
||||
this.element
|
||||
.removeData("draggable")
|
||||
.unbind(".draggable")
|
||||
.removeClass("ui-draggable"
|
||||
+ " ui-draggable-dragging"
|
||||
+ " ui-draggable-disabled");
|
||||
_destroy: function() {
|
||||
this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
|
||||
this._mouseDestroy();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_mouseCapture: function(event) {
|
||||
@ -102,6 +94,8 @@ $.widget("ui.draggable", $.ui.mouse, {
|
||||
//Create and append the visible helper
|
||||
this.helper = this._createHelper(event);
|
||||
|
||||
this.helper.addClass("ui-draggable-dragging");
|
||||
|
||||
//Cache the helper size
|
||||
this._cacheHelperProportions();
|
||||
|
||||
@ -162,7 +156,7 @@ $.widget("ui.draggable", $.ui.mouse, {
|
||||
if ($.ui.ddmanager && !o.dropBehaviour)
|
||||
$.ui.ddmanager.prepareOffsets(this, event);
|
||||
|
||||
this.helper.addClass("ui-draggable-dragging");
|
||||
|
||||
this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
|
||||
|
||||
//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
|
||||
|
9
ui/jquery.ui.droppable.js
vendored
9
ui/jquery.ui.droppable.js
vendored
@ -47,18 +47,13 @@ $.widget("ui.droppable", {
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
_destroy: function() {
|
||||
var drop = $.ui.ddmanager.droppables[this.options.scope];
|
||||
for ( var i = 0; i < drop.length; i++ )
|
||||
if ( drop[i] == this )
|
||||
drop.splice(i, 1);
|
||||
|
||||
this.element
|
||||
.removeClass("ui-droppable ui-droppable-disabled")
|
||||
.removeData("droppable")
|
||||
.unbind(".droppable");
|
||||
|
||||
return this;
|
||||
this.element.removeClass("ui-droppable ui-droppable-disabled");
|
||||
},
|
||||
|
||||
_setOption: function(key, value) {
|
||||
|
115
ui/jquery.ui.menu.js
vendored
115
ui/jquery.ui.menu.js
vendored
@ -13,8 +13,7 @@
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
var idIncrement = 0,
|
||||
currentEventTarget = null;
|
||||
var currentEventTarget = null;
|
||||
|
||||
$.widget( "ui.menu", {
|
||||
version: "@VERSION",
|
||||
@ -35,14 +34,11 @@ $.widget( "ui.menu", {
|
||||
},
|
||||
_create: function() {
|
||||
this.activeMenu = this.element;
|
||||
this.menuId = this.element.attr( "id" ) || "ui-menu-" + idIncrement++;
|
||||
if ( this.element.find( ".ui-icon" ).length ) {
|
||||
this.element.addClass( "ui-menu-icons" );
|
||||
}
|
||||
this.element
|
||||
.uniqueId()
|
||||
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
|
||||
.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
|
||||
.attr({
|
||||
id: this.menuId,
|
||||
role: this.options.role,
|
||||
tabIndex: 0
|
||||
})
|
||||
@ -95,9 +91,9 @@ $.widget( "ui.menu", {
|
||||
target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );
|
||||
this.focus( event, target );
|
||||
},
|
||||
"mouseleave": "collapseAll",
|
||||
mouseleave: "collapseAll",
|
||||
"mouseleave .ui-menu": "collapseAll",
|
||||
"focus": function( event ) {
|
||||
focus: function( event ) {
|
||||
var menu = this.element,
|
||||
firstItem = menu.children( ".ui-menu-item" ).eq( 0 );
|
||||
if ( this._hasScroll() && !this.active ) {
|
||||
@ -120,11 +116,13 @@ $.widget( "ui.menu", {
|
||||
}
|
||||
});
|
||||
},
|
||||
"keydown": "_keydown"
|
||||
keydown: "_keydown"
|
||||
});
|
||||
|
||||
this.refresh();
|
||||
|
||||
// TODO: We probably shouldn't bind to document for each menu.
|
||||
// TODO: This isn't being cleaned up on destroy.
|
||||
this._bind( this.document, {
|
||||
click: function( event ) {
|
||||
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
|
||||
@ -145,19 +143,22 @@ $.widget( "ui.menu", {
|
||||
.removeAttr( "aria-labelledby" )
|
||||
.removeAttr( "aria-expanded" )
|
||||
.removeAttr( "aria-hidden" )
|
||||
.removeAttr( "aria-disabled" )
|
||||
.removeUniqueId()
|
||||
.show();
|
||||
|
||||
// destroy menu items
|
||||
this.element.find( ".ui-menu-item" )
|
||||
.unbind( ".menu" )
|
||||
.removeClass( "ui-menu-item" )
|
||||
.removeAttr( "role" )
|
||||
.removeAttr( "aria-disabled" )
|
||||
.children( "a" )
|
||||
.removeUniqueId()
|
||||
.removeClass( "ui-corner-all ui-state-hover" )
|
||||
.removeAttr( "tabIndex" )
|
||||
.removeAttr( "role" )
|
||||
.removeAttr( "aria-haspopup" )
|
||||
.removeAttr( "id" )
|
||||
// TODO: is this correct? Don't these exist in the original markup?
|
||||
.children( ".ui-icon" )
|
||||
.remove();
|
||||
|
||||
@ -166,82 +167,80 @@ $.widget( "ui.menu", {
|
||||
},
|
||||
|
||||
_keydown: function( event ) {
|
||||
var match, prev, character, skip,
|
||||
preventDefault = true;
|
||||
|
||||
function escape( value ) {
|
||||
return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
|
||||
}
|
||||
|
||||
switch ( event.keyCode ) {
|
||||
case $.ui.keyCode.PAGE_UP:
|
||||
this.previousPage( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.PAGE_DOWN:
|
||||
this.nextPage( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.HOME:
|
||||
this._move( "first", "first", event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.END:
|
||||
this._move( "last", "last", event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.UP:
|
||||
this.previous( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.DOWN:
|
||||
this.next( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.LEFT:
|
||||
this.collapse( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.RIGHT:
|
||||
if ( !this.active.is( ".ui-state-disabled" ) ) {
|
||||
this.expand( event );
|
||||
}
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.ENTER:
|
||||
this._activate( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.SPACE:
|
||||
this._activate( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
case $.ui.keyCode.ESCAPE:
|
||||
this.collapse( event );
|
||||
event.preventDefault();
|
||||
break;
|
||||
default:
|
||||
preventDefault = false;
|
||||
prev = this.previousFilter || "";
|
||||
character = String.fromCharCode( event.keyCode );
|
||||
skip = false;
|
||||
|
||||
clearTimeout( this.filterTimer );
|
||||
var match,
|
||||
prev = this.previousFilter || "",
|
||||
character = String.fromCharCode( event.keyCode ),
|
||||
skip = false;
|
||||
|
||||
if ( character === prev ) {
|
||||
skip = true;
|
||||
} else {
|
||||
character = prev + character;
|
||||
}
|
||||
function escape( value ) {
|
||||
return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
||||
}
|
||||
|
||||
match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
|
||||
return new RegExp( "^" + escape( character ), "i" )
|
||||
.test( $( this ).children( "a" ).text() );
|
||||
});
|
||||
match = skip && match.index(this.active.next()) !== -1 ?
|
||||
this.active.nextAll(".ui-menu-item") :
|
||||
match = skip && match.index( this.active.next() ) !== -1 ?
|
||||
this.active.nextAll( ".ui-menu-item" ) :
|
||||
match;
|
||||
|
||||
// TODO: document what's going on here, character is reset to the original value
|
||||
if ( !match.length ) {
|
||||
character = String.fromCharCode(event.keyCode);
|
||||
match = this.activeMenu.children(".ui-menu-item").filter(function() {
|
||||
character = String.fromCharCode( event.keyCode );
|
||||
match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
|
||||
return new RegExp( "^" + escape(character), "i" )
|
||||
.test( $( this ).children( "a" ).text() );
|
||||
});
|
||||
}
|
||||
|
||||
if ( match.length ) {
|
||||
this.focus( event, match );
|
||||
if ( match.length > 1 ) {
|
||||
@ -256,6 +255,10 @@ $.widget( "ui.menu", {
|
||||
delete this.previousFilter;
|
||||
}
|
||||
}
|
||||
|
||||
if ( preventDefault ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
_activate: function( event ) {
|
||||
@ -271,7 +274,6 @@ $.widget( "ui.menu", {
|
||||
refresh: function() {
|
||||
// initialize nested menus
|
||||
var menus,
|
||||
menuId = this.menuId,
|
||||
submenus = this.element.find( this.options.menus + ":not(.ui-menu)" )
|
||||
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
|
||||
.hide()
|
||||
@ -288,15 +290,21 @@ $.widget( "ui.menu", {
|
||||
.addClass( "ui-menu-item" )
|
||||
.attr( "role", "presentation" )
|
||||
.children( "a" )
|
||||
.uniqueId()
|
||||
.addClass( "ui-corner-all" )
|
||||
.attr( "tabIndex", -1 )
|
||||
.attr( "role", this._itemRole() )
|
||||
.attr( "id", function( i ) {
|
||||
return menuId + "-" + i;
|
||||
.attr({
|
||||
tabIndex: -1,
|
||||
role: this._itemRole()
|
||||
});
|
||||
|
||||
// initialize unlinked menu-items as dividers
|
||||
menus.children( ":not(.ui-menu-item)" ).addClass( "ui-widget-content ui-menu-divider" );
|
||||
// initialize unlinked menu-items containing spaces and/or dashes only as dividers
|
||||
menus.children( ":not(.ui-menu-item)" ).each( function() {
|
||||
var item = $( this );
|
||||
// hypen, em dash, en dash
|
||||
if ( !/[^\-—–\s]/.test( item.text() ) ) {
|
||||
item.addClass( "ui-widget-content ui-menu-divider" );
|
||||
}
|
||||
});
|
||||
|
||||
// add aria-disabled attribute to any disabled menu item
|
||||
menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
|
||||
@ -305,7 +313,8 @@ $.widget( "ui.menu", {
|
||||
var menu = $( this ),
|
||||
item = menu.prev( "a" );
|
||||
|
||||
item.attr( "aria-haspopup", "true" )
|
||||
item
|
||||
.attr( "aria-haspopup", "true" )
|
||||
.prepend( '<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>' );
|
||||
menu.attr( "aria-labelledby", item.attr( "id" ) );
|
||||
});
|
||||
@ -333,7 +342,11 @@ $.widget( "ui.menu", {
|
||||
}
|
||||
|
||||
// highlight active parent menu item, if any
|
||||
this.active.parent().closest( ".ui-menu-item" ).children( "a:first" ).addClass( "ui-state-active" );
|
||||
this.active
|
||||
.parent()
|
||||
.closest( ".ui-menu-item" )
|
||||
.children( "a:first" )
|
||||
.addClass( "ui-state-active" );
|
||||
|
||||
if ( event && event.type === "keydown" ) {
|
||||
this._close();
|
||||
@ -401,18 +414,18 @@ $.widget( "ui.menu", {
|
||||
},
|
||||
|
||||
_open: function( submenu ) {
|
||||
var position = $.extend({
|
||||
of: this.active
|
||||
}, $.type( this.options.position ) === "function" ?
|
||||
this.options.position( this.active ) :
|
||||
this.options.position
|
||||
);
|
||||
|
||||
clearTimeout( this.timer );
|
||||
this.element.find( ".ui-menu" ).not( submenu.parents() )
|
||||
.hide()
|
||||
.attr( "aria-hidden", "true" );
|
||||
|
||||
var position = $.extend( {}, {
|
||||
of: this.active
|
||||
}, $.type( this.options.position ) === "function" ?
|
||||
this.options.position( this.active ) :
|
||||
this.options.position
|
||||
);
|
||||
|
||||
submenu
|
||||
.show()
|
||||
.removeAttr( "aria-hidden" )
|
||||
@ -476,7 +489,7 @@ $.widget( "ui.menu", {
|
||||
if ( newItem && newItem.length ) {
|
||||
this._open( newItem.parent() );
|
||||
|
||||
//timeout so Firefox will not hide activedescendant change in expanding submenu from AT
|
||||
// timeout so Firefox will not hide activedescendant change in expanding submenu from AT
|
||||
this._delay(function() {
|
||||
this.focus( event, newItem );
|
||||
}, 20 );
|
||||
|
4
ui/jquery.ui.resizable.js
vendored
4
ui/jquery.ui.resizable.js
vendored
@ -190,13 +190,13 @@ $.widget("ui.resizable", $.ui.mouse, {
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
_destroy: function() {
|
||||
|
||||
this._mouseDestroy();
|
||||
|
||||
var _destroy = function(exp) {
|
||||
$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
|
||||
.removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
|
||||
.removeData("resizable").removeData("ui-resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
|
||||
};
|
||||
|
||||
//TODO: Unwrap at same DOM position
|
||||
|
8
ui/jquery.ui.selectable.js
vendored
8
ui/jquery.ui.selectable.js
vendored
@ -61,17 +61,13 @@ $.widget("ui.selectable", $.ui.mouse, {
|
||||
this.helper = $("<div class='ui-selectable-helper'></div>");
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
_destroy: function() {
|
||||
this.selectees
|
||||
.removeClass("ui-selectee")
|
||||
.removeData("selectable-item");
|
||||
this.element
|
||||
.removeClass("ui-selectable ui-selectable-disabled")
|
||||
.removeData("selectable")
|
||||
.unbind(".selectable");
|
||||
.removeClass("ui-selectable ui-selectable-disabled");
|
||||
this._mouseDestroy();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_mouseStart: function(event) {
|
||||
|
3
ui/jquery.ui.spinner.js
vendored
3
ui/jquery.ui.spinner.js
vendored
@ -427,7 +427,7 @@ $.widget( "ui.spinner", {
|
||||
this._refresh();
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
_destroy: function() {
|
||||
this.element
|
||||
.removeClass( "ui-spinner-input" )
|
||||
.prop( "disabled", false )
|
||||
@ -436,7 +436,6 @@ $.widget( "ui.spinner", {
|
||||
.removeAttr( "aria-valuemin" )
|
||||
.removeAttr( "aria-valuemax" )
|
||||
.removeAttr( "aria-valuenow" );
|
||||
this._super();
|
||||
this.uiSpinner.replaceWith( this.element );
|
||||
},
|
||||
|
||||
|
78
ui/jquery.ui.tabs.js
vendored
78
ui/jquery.ui.tabs.js
vendored
@ -34,6 +34,7 @@ $.widget( "ui.tabs", {
|
||||
active: null,
|
||||
collapsible: false,
|
||||
event: "click",
|
||||
heightStyle: "content",
|
||||
hide: null,
|
||||
show: null,
|
||||
|
||||
@ -150,6 +151,10 @@ $.widget( "ui.tabs", {
|
||||
if ( key === "event" ) {
|
||||
this._setupEvents( value );
|
||||
}
|
||||
|
||||
if ( key === "heightStyle" ) {
|
||||
this._setupHeightStyle( value );
|
||||
}
|
||||
},
|
||||
|
||||
_tabId: function( tab ) {
|
||||
@ -202,6 +207,7 @@ $.widget( "ui.tabs", {
|
||||
|
||||
this._setupDisabled( options.disabled );
|
||||
this._setupEvents( options.event );
|
||||
this._setupHeightStyle( options.heightStyle );
|
||||
|
||||
// remove all handlers, may run on existing tabs
|
||||
this.lis.unbind( ".tabs" );
|
||||
@ -241,7 +247,9 @@ $.widget( "ui.tabs", {
|
||||
if ( panel.length) {
|
||||
that.panels = that.panels.add( panel );
|
||||
}
|
||||
tab.attr( "aria-controls", selector.substring( 1 ) );
|
||||
tab
|
||||
.data( "ui-tabs-aria-controls", tab.attr( "aria-controls" ) )
|
||||
.attr( "aria-controls", selector.substring( 1 ) );
|
||||
});
|
||||
},
|
||||
|
||||
@ -290,6 +298,50 @@ $.widget( "ui.tabs", {
|
||||
this._bind( this.anchors, events );
|
||||
},
|
||||
|
||||
_setupHeightStyle: function( heightStyle ) {
|
||||
var maxHeight, overflow,
|
||||
parent = this.element.parent();
|
||||
|
||||
if ( heightStyle === "fill" ) {
|
||||
// IE 6 treats height like minHeight, so we need to turn off overflow
|
||||
// in order to get a reliable height
|
||||
// we use the minHeight support test because we assume that only
|
||||
// browsers that don't support minHeight will treat height as minHeight
|
||||
if ( !$.support.minHeight ) {
|
||||
overflow = parent.css( "overflow" );
|
||||
parent.css( "overflow", "hidden");
|
||||
}
|
||||
maxHeight = parent.height();
|
||||
this.element.siblings( ":visible" ).each(function() {
|
||||
var elem = $( this ),
|
||||
position = elem.css( "position" );
|
||||
|
||||
if ( position === "absolute" || position === "fixed" ) {
|
||||
return;
|
||||
}
|
||||
maxHeight -= elem.outerHeight( true );
|
||||
});
|
||||
if ( overflow ) {
|
||||
parent.css( "overflow", overflow );
|
||||
}
|
||||
|
||||
this.element.children().not( this.panels ).each(function() {
|
||||
maxHeight -= $( this ).outerHeight( true );
|
||||
});
|
||||
|
||||
this.panels.each(function() {
|
||||
$( this ).height( Math.max( 0, maxHeight -
|
||||
$( this ).innerHeight() + $( this ).height() ) );
|
||||
})
|
||||
.css( "overflow", "auto" );
|
||||
} else if ( heightStyle === "auto" ) {
|
||||
maxHeight = 0;
|
||||
this.panels.each(function() {
|
||||
maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
|
||||
}).height( maxHeight );
|
||||
}
|
||||
},
|
||||
|
||||
_eventHandler: function( event ) {
|
||||
var options = this.options,
|
||||
active = this.active,
|
||||
@ -397,14 +449,8 @@ $.widget( "ui.tabs", {
|
||||
});
|
||||
},
|
||||
|
||||
_findActive: function( selector ) {
|
||||
if ( typeof selector === "number" ) {
|
||||
return this.lis.eq( selector );
|
||||
}
|
||||
if ( typeof selector === "string" ) {
|
||||
return this.anchors.filter( "[href$='" + selector + "']" ).closest( "li" );
|
||||
}
|
||||
return $();
|
||||
_findActive: function( index ) {
|
||||
return index === false ? $() : this.lis.eq( index );
|
||||
},
|
||||
|
||||
_getIndex: function( index ) {
|
||||
@ -448,6 +494,20 @@ $.widget( "ui.tabs", {
|
||||
}
|
||||
});
|
||||
|
||||
this.lis.each(function() {
|
||||
var li = $( this ),
|
||||
prev = li.data( "ui-tabs-aria-controls" );
|
||||
if ( prev ) {
|
||||
li.attr( "aria-controls", prev );
|
||||
} else {
|
||||
li.removeAttr( "aria-controls" );
|
||||
}
|
||||
});
|
||||
|
||||
if ( this.options.heightStyle !== "content" ) {
|
||||
this.panels.css( "height", "" );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user