Ticket #4506 (closed enhancement: fixed)
tabs(): allow more flexibility in specifying what list is used
| Reported by: | cjwilks | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.8 |
| Component: | ui.tabs | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I would like to propose adding an option to ui.tabs that allows a person to more flexibly configure what ul should be used. That option would provide an alternate list element for the tab navigation bar. In the diff and usage example below, I've named the option ul.
-
ui.tabs.js
old new 71 71 72 72 _tabify: function(init) { 73 73 74 this.list = this. element.children('ul:first');74 this.list = this.options.ul || this.element.children('ul:first'); 75 75 this.lis = $('li:has(a[href])', this.list); 76 76 this.anchors = this.lis.map(function() { return $('a', this)[0]; }); 77 77 this.panels = $([]);
Usage:
$("div#mytabs").tabs({ ul: $("#someotherlist") //use this other list as the tab nav });
In versions prior to 1.7.x the tabs() plugin targeted a ul directly. But the current code now expects a div that contains a ul as a direct child. This may fit in better with themeroller widget styles, but it does not always yield the layout a designer wants. (The ul may need to be wrapped in other intermediate elements, or it may need to be outside of the tab content pane entirely.)
Change History
comment:3 Changed 4 years ago by klaus.hartl
- Status changed from new to closed
- Resolution set to worksforme
The ul does not need to be in the tab content pane at all.


Sounds reasonable. Spec needed to decide how to handle this with regards to themes.