Skip to content

Commit

Permalink
Tabs: Removed instances of " .. + (++ .." to avoid a minification bug…
Browse files Browse the repository at this point in the history
… in closure compiler. Fixes #5576 - invalid increment operand.
  • Loading branch information
scottgonzalez committed May 18, 2010
1 parent bf67347 commit fcbf4c0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ui/jquery.ui.tabs.js
Expand Up @@ -16,6 +16,14 @@
var tabId = 0,
listId = 0;

function getNextTabId() {
return ++tabId;
}

function getNextListId() {
return ++listId;
}

$.widget("ui.tabs", {
options: {
add: null,
Expand Down Expand Up @@ -56,15 +64,15 @@ $.widget("ui.tabs", {

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

_sanitizeSelector: function(hash) {
return hash.replace(/:/g, '\\:'); // we need this because an id may contain a ":"
},

_cookie: function() {
var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + (++listId));
var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + getNextListId());
return $.cookie.apply(null, [cookie].concat($.makeArray(arguments)));
},

Expand Down

0 comments on commit fcbf4c0

Please sign in to comment.