Tabs broken in jQuery 1.4pre due to changes in $.data(elem)

2 views
Skip to first unread message

Mark Gibson

unread,
Oct 14, 2009, 1:36:46 PM10/14/09
to jquery...@googlegroups.com
Hi guys,
Are you aware that $.data(elem) is changing in jQuery 1.4?
It will no longer return an id. So here's a patch to fix it's usage in tabs.
- Mark Gibson


Index: ui/jquery.ui.tabs.js
===================================================================
--- ui/jquery.ui.tabs.js (revision 3364)
+++ ui/jquery.ui.tabs.js (working copy)
@@ -12,6 +12,8 @@
*/
(function($) {

+var tabId = 0;
+
$.widget("ui.tabs", {

_init: function() {
@@ -39,7 +41,7 @@

_tabId: function(a) {
return a.title && a.title.replace(/\s/g,
'_').replace(/[^A-Za-z0-9\-_:\.]/g, '') ||
- this.options.idPrefix + $.data(a);
+ this.options.idPrefix + (++tabId);
},

_sanitizeSelector: function(hash) {

Richard D. Worth

unread,
Oct 16, 2009, 9:30:51 PM10/16/09
to jquery...@googlegroups.com
Thanks for the patch. Fixed in


- Richard

Jörn Zaefferer

unread,
Oct 17, 2009, 7:12:39 AM10/17/09
to jquery...@googlegroups.com
Is there a ticket?

Jörn

Richard D. Worth

unread,
Oct 17, 2009, 7:46:22 AM10/17/09
to jquery...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages