Accordion: Remove core event/alias and deprecated module dependencies

This commit is contained in:
Alexander Schmitz 2015-05-13 21:52:09 -04:00
parent ad98cb1673
commit b240eed81b
6 changed files with 15 additions and 15 deletions

View File

@ -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 {

View File

@ -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
});

View File

@ -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 );
});

View File

@ -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 );

View File

@ -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 );
});

View File

@ -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" );
}
},