mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tabs: Deprecate the length method. Fixes #7143 Tabs: Deprecate the length method
This commit is contained in:
parent
e378876918
commit
03eb54b379
@ -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);
|
||||
|
@ -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');
|
||||
|
||||
});
|
||||
|
||||
|
10
ui/jquery.ui.tabs.js
vendored
10
ui/jquery.ui.tabs.js
vendored
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user