Skip to main content

Search and Top Navigation

#4277 closed enhancement (fixed)

Opened March 05, 2009 09:54AM UTC

Closed March 05, 2009 11:51PM UTC

Last modified October 11, 2012 09:15PM UTC

Tabs tabify's all LIs including those in panels

Reported by: deburca Owned by:
Priority: minor Milestone:
Component: ui.tabs Version: 1.6rc6
Keywords: Cc:
Blocked by: Blocking:
Description

With the following HTML

#!xml
<div class="container">
  <ul>
    <li><a href="#tab1">Tab 1</a></li>
    <li><a href="#tab2">Tab 2</a></li>
  </ul>
  <div class="tab1">
    <ul>
      <li><a href="page1.htm">List item 1.1</a></li>
      <li><a href="page2.htm">List item 1.2</a></li>
    </ul>
  </div>
  <div class="tab2">
    <ul>
      <li><a href="page3.htm">List item 2.1</a></li>
      <li><a href="page4.htm">List item 2.2</a></li>
    </ul>
  </div>
</div>

a $('.container').tabs() will tabify all LIs, including those for list items 1.1, 1.2, 2.1 and 2.2. These later list items load page1.htm, page2.htm, page3.htm and page4.htm respectively via AJAX when clicked.

A solution is to narrow the tabify by specifying the first UL within the DIV container.

Updating the JS from

tabify: function(init) {
  this.$lis = $('li:has(a[href])', this.element);

to

tabify: function(init) {
  this.$lis = $('ul:first li:has(a[href])', this.element);

solves this issue.

The scope for the tabs could be kept as a config option - defaulting to 'UL', but allowing users to override with 'UL:first' or any other selector.

Attachments (0)
Change History (2)

Changed March 05, 2009 11:51PM UTC by klaus.hartl comment:1

resolution: → fixed
status: newclosed

fixed already in a later revision

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:2

milestone: TBD

Milestone TBD deleted