Skip to main content

Search and Top Navigation

#8207 closed bug (fixed)

Opened March 22, 2012 04:06PM UTC

Closed March 22, 2012 05:17PM UTC

Last modified March 22, 2012 05:19PM UTC

Tabs: Error with href selector.

Reported by: mdibbets Owned by:
Priority: minor Milestone: 1.8.19
Component: ui.tabs Version: 1.8.18
Keywords: Cc:
Blocked by: Blocking:
Description

In the current version of jqueryui there is an error when trying to select a tab by url and not by index.

The error lies in the following.

''The code currently used is:''

 _getIndex: function( index ) {
		// meta-function to give users option to provide a href string instead of a numerical index.
		// also sanitizes numerical indexes to valid values.
		if ( typeof index == "string" ) {
			index = this.anchors.index( this.anchors.filter( "[href$=" + index + "]" ) );
		}

		return index;
	},

There is an error since jquery requires quotes nowadays.

 _getIndex: function( index ) {
		// meta-function to give users option to provide a href string instead of a numerical index.
		// also sanitizes numerical indexes to valid values.
		if ( typeof index == "string" ) {
			index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
		}

		return index;
	},

The above is the corrected code. This works perfectly.

If I may suggest, also highlight in the documentation that when generating tabs from ajax etc...(I use php backend to dynamically generate tabs for editorial purposes of a magazine and all have a different url), that you can also use the URL instead of tab index. It's not really mentioned there, but it is a life saver when using dynamically generated tabs.

Also, please include a feature that you can check if a tab with a certain ajax url already exists.

Attachments (0)
Change History (4)

Changed March 22, 2012 05:17PM UTC by scottgonzalez comment:1

summary: [href= errorTabs: Error with href selector.

Changed March 22, 2012 05:17PM UTC by Scott González comment:2

resolution: → fixed
status: newclosed

Tabs: Wrap attribute value in quotes when querying. Fixes #8207 - Tabs: Error with href selector.

Changeset: adbc2733bbd4d4c117dd2e0f31d5156e2913bfd1

Changed March 22, 2012 05:17PM UTC by Scott González comment:3

Tabs: Wrap attribute value in quotes when querying. Fixes #8207 - Tabs: Error with href selector.

(cherry picked from commit adbc2733bbd4d4c117dd2e0f31d5156e2913bfd1)

Changeset: 090ce4369d12751f2e55e62f6cc7f7fbc5dc6f2a

Changed March 22, 2012 05:19PM UTC by scottgonzalez comment:4

milestone: 1.91.8.19