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({
|
$( "#accordion" ).accordion({
|
||||||
icons: icons
|
icons: icons
|
||||||
});
|
});
|
||||||
$( "#toggle" ).button().click(function() {
|
$( "#toggle" ).button().on( "click", function() {
|
||||||
if ( $( "#accordion" ).accordion( "option", "icons" ) ) {
|
if ( $( "#accordion" ).accordion( "option", "icons" ) ) {
|
||||||
$( "#accordion" ).accordion( "option", "icons", null );
|
$( "#accordion" ).accordion( "option", "icons", null );
|
||||||
} else {
|
} else {
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
*/
|
*/
|
||||||
$.event.special.hoverintent = {
|
$.event.special.hoverintent = {
|
||||||
setup: function() {
|
setup: function() {
|
||||||
$( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
|
$( this ).on( "mouseover", jQuery.event.special.hoverintent.handler );
|
||||||
},
|
},
|
||||||
teardown: function() {
|
teardown: function() {
|
||||||
$( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
|
$( this ).off( "mouseover", jQuery.event.special.hoverintent.handler );
|
||||||
},
|
},
|
||||||
handler: function( event ) {
|
handler: function( event ) {
|
||||||
var currentX, currentY, timeout,
|
var currentX, currentY, timeout,
|
||||||
@ -42,8 +42,8 @@
|
|||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
target
|
target
|
||||||
.unbind( "mousemove", track )
|
.off( "mousemove", track )
|
||||||
.unbind( "mouseout", clear );
|
.off( "mouseout", clear );
|
||||||
clearTimeout( timeout );
|
clearTimeout( timeout );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
timeout = setTimeout( handler, 100 );
|
timeout = setTimeout( handler, 100 );
|
||||||
target.bind({
|
target.on({
|
||||||
mousemove: track,
|
mousemove: track,
|
||||||
mouseout: clear
|
mouseout: clear
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@ $.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( typ
|
|||||||
test( "handle click on header-descendant", function() {
|
test( "handle click on header-descendant", function() {
|
||||||
expect( 1 );
|
expect( 1 );
|
||||||
var element = $( "#navigation" ).accordion();
|
var element = $( "#navigation" ).accordion();
|
||||||
$( "#navigation h2:eq(1) a" ).click();
|
$( "#navigation h2:eq(1) a" ).trigger( "click" );
|
||||||
state( element, 0, 1, 0 );
|
state( element, 0, 1, 0 );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ test( "beforeActivate", function() {
|
|||||||
strictEqual( ui.newPanel[ 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 ).trigger( "click" );
|
||||||
state( element, 0, 1, 0 );
|
state( element, 0, 1, 0 );
|
||||||
|
|
||||||
element.one( "accordionbeforeactivate", function( event, ui ) {
|
element.one( "accordionbeforeactivate", function( event, ui ) {
|
||||||
@ -142,7 +142,7 @@ test( "activate", function() {
|
|||||||
equal( ui.newPanel.length, 1 );
|
equal( ui.newPanel.length, 1 );
|
||||||
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
|
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
|
||||||
});
|
});
|
||||||
headers.eq( 1 ).click();
|
headers.eq( 1 ).trigger( "click" );
|
||||||
|
|
||||||
element.one( "accordionactivate", function( event, ui ) {
|
element.one( "accordionactivate", function( event, ui ) {
|
||||||
equal( ui.oldHeader.length, 1 );
|
equal( ui.oldHeader.length, 1 );
|
||||||
|
@ -60,7 +60,7 @@ test( "{ active: Number }", function() {
|
|||||||
equal( element.accordion( "option", "active" ), 0 );
|
equal( element.accordion( "option", "active" ), 0 );
|
||||||
state( element, 1, 0, 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 );
|
equal( element.accordion( "option", "active" ), 1 );
|
||||||
state( element, 0, 1, 0 );
|
state( element, 0, 1, 0 );
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ test( "{ collapsible: false }", function() {
|
|||||||
equal( element.accordion( "option", "active" ), 1 );
|
equal( element.accordion( "option", "active" ), 1 );
|
||||||
state( element, 0, 1, 0 );
|
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 );
|
equal( element.accordion( "option", "active" ), 1 );
|
||||||
state( element, 0, 1, 0 );
|
state( element, 0, 1, 0 );
|
||||||
});
|
});
|
||||||
@ -289,7 +289,7 @@ test( "{ collapsible: true }", function() {
|
|||||||
equal( element.accordion( "option", "active" ), 1 );
|
equal( element.accordion( "option", "active" ), 1 );
|
||||||
state( element, 0, 1, 0 );
|
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 );
|
equal( element.accordion( "option", "active" ), false );
|
||||||
state( element, 0, 0, 0 );
|
state( element, 0, 0, 0 );
|
||||||
});
|
});
|
||||||
@ -306,7 +306,7 @@ test( "{ event: null }", function() {
|
|||||||
state( element, 0, 1, 0 );
|
state( element, 0, 1, 0 );
|
||||||
|
|
||||||
// ensure default click handler isn't bound
|
// 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 );
|
equal( element.accordion( "option", "active" ), 1 );
|
||||||
state( element, 0, 1, 0 );
|
state( element, 0, 1, 0 );
|
||||||
});
|
});
|
||||||
|
@ -217,14 +217,14 @@ return $.widget( "ui.accordion", {
|
|||||||
if ( toFocus ) {
|
if ( toFocus ) {
|
||||||
$( event.target ).attr( "tabIndex", -1 );
|
$( event.target ).attr( "tabIndex", -1 );
|
||||||
$( toFocus ).attr( "tabIndex", 0 );
|
$( toFocus ).attr( "tabIndex", 0 );
|
||||||
toFocus.focus();
|
$( toFocus ).trigger( "focus" );
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_panelKeyDown: function( event ) {
|
_panelKeyDown: function( event ) {
|
||||||
if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
|
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