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