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

瀏覽次數:2 次
跳到第一則未讀訊息

Mark Gibson

未讀,
2009年10月14日 下午1:36:462009/10/14
收件者: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

未讀,
2009年10月16日 晚上9:30:512009/10/16
收件者:jquery...@googlegroups.com
Thanks for the patch. Fixed in


- Richard

Jörn Zaefferer

未讀,
2009年10月17日 清晨7:12:392009/10/17
收件者:jquery...@googlegroups.com
Is there a ticket?

Jörn

Richard D. Worth

未讀,
2009年10月17日 清晨7:46:222009/10/17
收件者:jquery...@googlegroups.com
回覆所有人
回覆作者
轉寄
0 則新訊息