BUGFIX Fixed TabSet.js initialisation with cookies, default to first tab rather than allowing tab deselects through an index of -1

This commit is contained in:
Ingo Schommer 2012-02-28 16:55:41 +01:00
parent a62881a137
commit 34d3f29a95

View File

@ -17,11 +17,12 @@
redrawTabs: function() {
this.rewriteHashlinks();
// Initialize jQuery UI tabs
var id = this.attr('id');
this.tabs({
cookie: ($.cookie && id) ? { expires: 30, path: '/', name: 'ui-tabs-' + id } : false
});
var id = this.attr('id'), cookieId = 'ui-tabs-' + id;
// Fix for wrong cookie storage of deselected tabs
if($.cookie && id && $.cookie(cookieId) == -1) $.cookie(cookieId, 0);
this.tabs({cookie: ($.cookie && id) ? { expires: 30, path: '/', name: cookieId } : false});
},
/**