Skip to content
Permalink
Browse files

Tabs: Deprecate the length method. Fixes #7143 Tabs: Deprecate the le…

…ngth method
  • Loading branch information...
petersendidit committed Mar 26, 2011
1 parent e378876 commit 03eb54b37902db771accd3a53bad1b927c058bc7
Showing with 14 additions and 13 deletions.
  1. +6 −0 tests/unit/tabs/tabs_deprecated.js
  2. +0 −7 tests/unit/tabs/tabs_methods.js
  3. +2 −2 tests/unit/tabs/tabs_tickets.js
  4. +6 −4 ui/jquery.ui.tabs.js
@@ -139,7 +139,13 @@ test('#5069 - ui.tabs.add creates two tab panels when using a full URL', functio
equals(el.children('div').length, el.find('> ul > li').length, 'After creation, number of panels should be equal to number of tabs');
el.tabs('add', '/ajax_html_echo', 'Test');
equals(el.children('div').length, el.find('> ul > li').length, 'After add, number of panels should be equal to number of tabs');
});

test('length', function() {
expect(1);

el = $('#tabs1').tabs();
equals(el.tabs('length'), $('ul a', el).length, ' should return length');
});

}( jQuery ) );
@@ -167,11 +167,4 @@ test('url', function() {
ok(false, "missing test - untested code is broken code.");
});

test('length', function() {
expect(1);

el = $('#tabs1').tabs();
equals(el.tabs('length'), $('ul a', el).length, ' should return length');
});

})(jQuery);
@@ -54,7 +54,7 @@ test('#4033 - IE expands hash to full url and misinterprets tab as ajax', functi

el = $('<div><ul><li><a href="#tab">Tab</a></li></ul><div id="tab"></div></div>')
.appendTo('#main').tabs();

equals($('a', el).data('load.tabs'), undefined, 'should not create ajax tab');

});
@@ -64,7 +64,7 @@ test('#5893 - Sublist in the tab list are considered as tab', function() {
expect(1);

el = $('#tabs6').tabs();
equals(el.tabs( "length" ), 2, 'should contain 2 tab');
equals(el.data("tabs").anchors.length, 2, 'should contain 2 tab');

});

@@ -568,10 +568,6 @@ $.widget( "ui.tabs", {
url: function( index, url ) {
this.anchors.eq( index ).data( "load.tabs", url );
return this;
},

length: function() {
return this.anchors.length;
}
});

@@ -812,6 +808,12 @@ if ( $.uiBackCompat !== false ) {
};
}( jQuery, jQuery.ui.tabs.prototype ) );

// length method
(function( $, prototype ) {
prototype.length = function() {
return this.anchors.length;
};
}( jQuery, jQuery.ui.tabs.prototype ) );
}

})( jQuery );

0 comments on commit 03eb54b

Please sign in to comment.
You can’t perform that action at this time.