mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accordion: Remove core event/alias and deprecated module dependencies
This commit is contained in:
parent
ad98cb1673
commit
b240eed81b
@ -19,7 +19,7 @@
|
||||
$( "#accordion" ).accordion({
|
||||
icons: icons
|
||||
});
|
||||
$( "#toggle" ).button().click(function() {
|
||||
$( "#toggle" ).button().on( "click", function() {
|
||||
if ( $( "#accordion" ).accordion( "option", "icons" ) ) {
|
||||
$( "#accordion" ).accordion( "option", "icons", null );
|
||||
} else {
|
||||
|
@ -23,10 +23,10 @@
|
||||
*/
|
||||
$.event.special.hoverintent = {
|
||||
setup: function() {
|
||||
$( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
|
||||
$( this ).on( "mouseover", jQuery.event.special.hoverintent.handler );
|
||||
},
|
||||
teardown: function() {
|
||||
$( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
|
||||
$( this ).off( "mouseover", jQuery.event.special.hoverintent.handler );
|
||||
},
|
||||
handler: function( event ) {
|
||||
var currentX, currentY, timeout,
|
||||
@ -42,8 +42,8 @@
|
||||
|
||||
function clear() {
|
||||
target
|
||||
.unbind( "mousemove", track )
|
||||
.unbind( "mouseout", clear );
|
||||
.off( "mousemove", track )
|
||||
.off( "mouseout", clear );
|
||||
clearTimeout( timeout );
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
}
|
||||
|
||||
timeout = setTimeout( handler, 100 );
|
||||
target.bind({
|
||||
target.on({
|
||||
mousemove: track,
|
||||
mouseout: clear
|
||||
});
|
||||
|
@ -38,7 +38,7 @@ $.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( typ
|
||||
test( "handle click on header-descendant", function() {
|
||||
expect( 1 );
|
||||
var element = $( "#navigation" ).accordion();
|
||||
$( "#navigation h2:eq(1) a" ).click();
|
||||
$( "#navigation h2:eq(1) a" ).trigger( "click" );
|
||||
state( element, 0, 1, 0 );
|
||||
});
|
||||
|
||||
|
@ -82,7 +82,7 @@ test( "beforeActivate", function() {
|
||||
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
|
||||
state( element, 1, 0, 0 );
|
||||
});
|
||||
headers.eq( 1 ).click();
|
||||
headers.eq( 1 ).trigger( "click" );
|
||||
state( element, 0, 1, 0 );
|
||||
|
||||
element.one( "accordionbeforeactivate", function( event, ui ) {
|
||||
@ -142,7 +142,7 @@ test( "activate", function() {
|
||||
equal( ui.newPanel.length, 1 );
|
||||
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
|
||||
});
|
||||
headers.eq( 1 ).click();
|
||||
headers.eq( 1 ).trigger( "click" );
|
||||
|
||||
element.one( "accordionactivate", function( event, ui ) {
|
||||
equal( ui.oldHeader.length, 1 );
|
||||
|
@ -60,7 +60,7 @@ test( "{ active: Number }", function() {
|
||||
equal( element.accordion( "option", "active" ), 0 );
|
||||
state( element, 1, 0, 0 );
|
||||
|
||||
element.find( ".ui-accordion-header" ).eq( 1 ).click();
|
||||
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" );
|
||||
equal( element.accordion( "option", "active" ), 1 );
|
||||
state( element, 0, 1, 0 );
|
||||
|
||||
@ -269,7 +269,7 @@ test( "{ collapsible: false }", function() {
|
||||
equal( element.accordion( "option", "active" ), 1 );
|
||||
state( element, 0, 1, 0 );
|
||||
|
||||
element.find( ".ui-accordion-header" ).eq( 1 ).click();
|
||||
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" );
|
||||
equal( element.accordion( "option", "active" ), 1 );
|
||||
state( element, 0, 1, 0 );
|
||||
});
|
||||
@ -289,7 +289,7 @@ test( "{ collapsible: true }", function() {
|
||||
equal( element.accordion( "option", "active" ), 1 );
|
||||
state( element, 0, 1, 0 );
|
||||
|
||||
element.find( ".ui-accordion-header" ).eq( 1 ).click();
|
||||
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" );
|
||||
equal( element.accordion( "option", "active" ), false );
|
||||
state( element, 0, 0, 0 );
|
||||
});
|
||||
@ -306,7 +306,7 @@ test( "{ event: null }", function() {
|
||||
state( element, 0, 1, 0 );
|
||||
|
||||
// ensure default click handler isn't bound
|
||||
element.find( ".ui-accordion-header" ).eq( 2 ).click();
|
||||
element.find( ".ui-accordion-header" ).eq( 2 ).trigger( "click" );
|
||||
equal( element.accordion( "option", "active" ), 1 );
|
||||
state( element, 0, 1, 0 );
|
||||
});
|
||||
|
@ -217,14 +217,14 @@ return $.widget( "ui.accordion", {
|
||||
if ( toFocus ) {
|
||||
$( event.target ).attr( "tabIndex", -1 );
|
||||
$( toFocus ).attr( "tabIndex", 0 );
|
||||
toFocus.focus();
|
||||
$( toFocus ).trigger( "focus" );
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
_panelKeyDown: function( event ) {
|
||||
if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
|
||||
$( event.currentTarget ).prev().focus();
|
||||
$( event.currentTarget ).prev().trigger( "focus" );
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user