Opened 14 years ago
Closed 13 years ago
#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: | ||
Blocked by: | Blocking: |
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 (5)
comment:1 Changed 14 years ago by
Milestone: | TBD → 1.8 |
---|
comment:3 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
The ul does not need to be in the tab content pane at all.
comment:4 Changed 13 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
The ul does currently have to be a direct child of the container. We should be able to remove this restriction while still requiring the nav to be the first ul in the container.
comment:5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in r3421. The first descendant list found will be used now.
Sounds reasonable. Spec needed to decide how to handle this with regards to themes.