mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Accordion: Removed deprecated navigation options. Fixes #5870 - Accordion: Remove navigation options.
This commit is contained in:
parent
0cdd5591be
commit
09eed560f8
@ -13,8 +13,6 @@ TestHelpers.commonWidgetTests( "accordion", {
|
|||||||
"header": "ui-icon-triangle-1-e",
|
"header": "ui-icon-triangle-1-e",
|
||||||
"headerSelected": "ui-icon-triangle-1-s"
|
"headerSelected": "ui-icon-triangle-1-s"
|
||||||
},
|
},
|
||||||
navigation: false,
|
|
||||||
navigationFilter: function() {},
|
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
activate: null,
|
activate: null,
|
||||||
|
@ -143,36 +143,6 @@ test( "resize", function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
module( "accordion (deprecated) - navigation", setupTeardown() );
|
|
||||||
|
|
||||||
test( "{ navigation: true, navigationFilter: header }", function() {
|
|
||||||
expect( 2 );
|
|
||||||
var element = $( "#navigation" ).accordion({
|
|
||||||
navigation: true,
|
|
||||||
navigationFilter: function() {
|
|
||||||
return (/\?p=1\.1\.3$/).test( this.href );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
equal( element.accordion( "option", "active" ), 2 );
|
|
||||||
state( element, 0, 0, 1 );
|
|
||||||
});
|
|
||||||
|
|
||||||
test( "{ navigation: true, navigationFilter: content }", function() {
|
|
||||||
expect( 2 );
|
|
||||||
var element = $( "#navigation" ).accordion({
|
|
||||||
navigation: true,
|
|
||||||
navigationFilter: function() {
|
|
||||||
return (/\?p=1\.1\.3\.2$/).test( this.href );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
equal( element.accordion( "option", "active" ), 2 );
|
|
||||||
state( element, 0, 0, 1 );
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module( "accordion (deprecated) - changestart/change events", setupTeardown() );
|
module( "accordion (deprecated) - changestart/change events", setupTeardown() );
|
||||||
|
|
||||||
test( "changestart", function() {
|
test( "changestart", function() {
|
||||||
|
32
ui/jquery.ui.accordion.js
vendored
32
ui/jquery.ui.accordion.js
vendored
@ -544,38 +544,6 @@ $.widget( "ui.accordion", {
|
|||||||
|
|
||||||
// DEPRECATED
|
// DEPRECATED
|
||||||
if ( $.uiBackCompat !== false ) {
|
if ( $.uiBackCompat !== false ) {
|
||||||
// navigation options
|
|
||||||
(function( $, prototype ) {
|
|
||||||
$.extend( prototype.options, {
|
|
||||||
navigation: false,
|
|
||||||
navigationFilter: function() {
|
|
||||||
return this.href.toLowerCase() === location.href.toLowerCase();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var _create = prototype._create;
|
|
||||||
prototype._create = function() {
|
|
||||||
if ( this.options.navigation ) {
|
|
||||||
var that = this,
|
|
||||||
headers = this.element.find( this.options.header ),
|
|
||||||
content = headers.next(),
|
|
||||||
current = headers.add( content )
|
|
||||||
.find( "a" )
|
|
||||||
.filter( this.options.navigationFilter )
|
|
||||||
[ 0 ];
|
|
||||||
if ( current ) {
|
|
||||||
headers.add( content ).each( function( index ) {
|
|
||||||
if ( $.contains( this, current ) ) {
|
|
||||||
that.options.active = Math.floor( index / 2 );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_create.call( this );
|
|
||||||
};
|
|
||||||
}( jQuery, jQuery.ui.accordion.prototype ) );
|
|
||||||
|
|
||||||
// icon options
|
// icon options
|
||||||
(function( $, prototype ) {
|
(function( $, prototype ) {
|
||||||
$.extend( prototype.options.icons, {
|
$.extend( prototype.options.icons, {
|
||||||
|
Loading…
Reference in New Issue
Block a user