Skip to main content

Search and Top Navigation

#3594 closed enhancement (worksforme)

Opened November 15, 2008 07:55PM UTC

Closed December 08, 2008 04:21PM UTC

Last modified October 11, 2012 09:15PM UTC

selectOnAdd

Reported by: brian Owned by: klaus.hartl
Priority: minor Milestone:
Component: ui.tabs Version: 1.6rc2
Keywords: Cc:
Blocked by: Blocking:
Description

Add the option to automatically select new tabs when they are added.

Code changes:

  • Add "selectOnAdd: false" as default for option.
  • Add "if (o.selectOnAdd) this.select(index);" as last line on "add" function

Note: Attached ui.tabs.js includes fix for ticket #3593 so "add" functionality works correctly.

Attachments (1)
  • selectOnAdd.zip (26.5 KB) - added by brian November 15, 2008 07:55PM UTC.
Change History (4)

Changed November 16, 2008 05:36AM UTC by scottgonzalez comment:1

Perhaps allowing negative numbers for the index (to start from the right instead of the left) would prevent the need for this option.

$(el).tabs('add', '#foo', 'new label').tabs('select', -1);

This could probably be limited to only allowing -1 for the last tab if that would be easier.

Changed November 18, 2008 12:38AM UTC by brian comment:2

That is one possibility. But tabs could be added to the middle of the list too. That would require some additional logic.

It'd just be nice to have the option of making it the default behavior when you initialize the tabs.

Changed December 08, 2008 04:21PM UTC by klaus.hartl comment:3

resolution: → worksforme
status: newclosed

No need for an option in the core IMHO. A simple solution is already described here:

http://docs.jquery.com/UI/Tabs#...immediately_select_a_just_added_tab.3F

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

milestone: TBD

Milestone TBD deleted