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:


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  
    7272       _tabify: function(init) {
    74                this.list = this.element.children('ul:first');
     74               this.list = this.options.ul || this.element.children('ul:first');
    7575               this.lis = $('li:has(a[href])', this.list);
    7676               this.anchors = { return $('a', this)[0]; });
    7777               this.panels = $([]);


    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 Jörn Zaefferer

Milestone: TBD1.8

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

comment:2 Changed 14 years ago by Jörn Zaefferer

Related to #4501.

comment:3 Changed 14 years ago by klaus.hartl

Resolution: worksforme
Status: newclosed

The ul does not need to be in the tab content pane at all.

comment:4 Changed 13 years ago by Scott González

Resolution: worksforme
Status: closedreopened

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 Scott González

Resolution: fixed
Status: reopenedclosed

Fixed in r3421. The first descendant list found will be used now.

Note: See TracTickets for help on using tickets.