Skip to main content

Search and Top Navigation

#9363 closed bug (notabug)

Opened June 07, 2013 09:54AM UTC

Closed June 07, 2013 12:28PM UTC

jquery ui tab content can be opened as new browse pace

Reported by: alexscr Owned by:
Priority: minor Milestone: none
Component: ui.tabs Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

In previous versions of jQuery UI (<=1.8), the link for a remote tab would be swapped with a local link when the tabs are loaded. This made it possible to center click (aka, open link in new browser tab) on the tab, and it would deep link to the current page with the tab selected. This is the behavior I would like to maintain.

Old Tabs:

<div id="tabs">
  <ul>
    <li><a href="some-ajax-content.php" title="section1">Content 1/a></li>
    <li><a href="some-other-ajax-content.php" title="section2">Content 2</a></li>
  </ul>
  <div id="section 1">Loading Content...</div>
  <div id="section 2">Loading Content...</div>
</div>

After calling $('#tabs').tabs(), this would result:

<div id="tabs">
  <ul>
    <li><a href="#section1" title="section1">Content 1/a></li>
    <li><a href="#section2" title="section2">Content 2</a></li>
  </ul>
  <div id="section 1">Loading Content...</div>
  <div id="section 2">Loading Content...</div>
</div>

New Tabs (With UI >=1.9)

<div id="tabs">
  <ul>
    <li aria-controls="section1"><a href="some-ajax-content.php">Content 1/a></li>
    <li aria-controls="section1"><a href="some-other-ajax-content.php">Content 2</a></li>
  </ul>
  <div id="section 1">Loading Content...</div>
  <div id="section 2">Loading Content...</div>
</div>

After calling $('#tabs').tabs():

<div id="tabs">
  <ul>
    <li aria-controls="section1"><a href="some-ajax-content.php">Content 1/a></li>
    <li aria-controls="section1"><a href="some-other-ajax-content.php">Content 2</a></li>
  </ul>
  <div id="section 1">Loading Content...</div>
  <div id="section 2">Loading Content...</div>
</div>

After calling $('#tabs').tabs(), the href attribute is not swapped. This means that if a user clicks to open a link in a new tab, the will directly load the ajax content. As I would expect is common, the ajax content is just part of the page that shouldn't be rendered on it's own. Is there an easy way to change the markup to restore the previous behavior?

Attachments (0)
Change History (1)

Changed June 07, 2013 12:28PM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

This is not a bug, it's a design change. Please ask for help on the forums or Stack Overflow.