]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Removed deprecated navigation options. Fixes #5870 - Accordion: Remove...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 24 Oct 2012 14:54:31 +0000 (10:54 -0400)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 24 Oct 2012 21:44:06 +0000 (17:44 -0400)
tests/unit/accordion/accordion_common_deprecated.js
tests/unit/accordion/accordion_deprecated.js
ui/jquery.ui.accordion.js

index 23324a0addc0034ec71a80983b81dfa92153e4dd..9adb074c4ca6adbbf67b86a97b80794498753546 100644 (file)
@@ -13,8 +13,6 @@ TestHelpers.commonWidgetTests( "accordion", {
                        "header": "ui-icon-triangle-1-e",
                        "headerSelected": "ui-icon-triangle-1-s"
                },
-               navigation: false,
-               navigationFilter: function() {},
 
                // callbacks
                activate: null,
index b8f4995423adfbfa261db0f15c41bc7be7c4b40f..2fb509c442b7a0cc20b76d50af720b8f3a575f3b 100644 (file)
@@ -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() );
 
 test( "changestart", function() {
index 4f1a6674bf23deaa8224a009b3c4367e42ebf9f7..f9cf733d52330bf779d1d65adcaffe69d174529e 100644 (file)
@@ -544,38 +544,6 @@ $.widget( "ui.accordion", {
 
 // DEPRECATED
 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
        (function( $, prototype ) {
                $.extend( prototype.options.icons, {