aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.tabs.js
diff options
context:
space:
mode:
authorChi Cheng <cloudream@gmail.com>2008-08-16 07:34:55 +0000
committerChi Cheng <cloudream@gmail.com>2008-08-16 07:34:55 +0000
commit91c492a49ca7107e74fff1c46228d039f7fb77ce (patch)
treeffce51f2c321a67c80283e299077ab46315d8522 /ui/ui.tabs.js
parentc5608784db54180de578632b8d3c9b4ac5c006e3 (diff)
downloadjquery-ui-91c492a49ca7107e74fff1c46228d039f7fb77ce.tar.gz
jquery-ui-91c492a49ca7107e74fff1c46228d039f7fb77ce.zip
tabs: internal methods, fixs #3208
Diffstat (limited to 'ui/ui.tabs.js')
-rw-r--r--ui/ui.tabs.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js
index 7f54e36aa..0e73484db 100644
--- a/ui/ui.tabs.js
+++ b/ui/ui.tabs.js
@@ -17,20 +17,20 @@ $.widget("ui.tabs", {
this.options.event += '.tabs'; // namespace event
// create tabs
- this.tabify(true);
+ this._tabify(true);
},
setData: function(key, value) {
if ((/^selected/).test(key))
this.select(value);
else {
this.options[key] = value;
- this.tabify();
+ this._tabify();
}
},
length: function() {
return this.$tabs.length;
},
- tabId: function(a) {
+ _tabId: function(a) {
return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '')
|| this.options.idPrefix + $.data(a);
},
@@ -42,7 +42,7 @@ $.widget("ui.tabs", {
index: this.$tabs.index(tab)
};
},
- tabify: function(init) {
+ _tabify: function(init) {
this.$lis = $('li:has(a[href])', this.element);
this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
@@ -58,7 +58,7 @@ $.widget("ui.tabs", {
else if ($(a).attr('href') != '#') { // prevent loading the page itself if href is just "#"
$.data(a, 'href.tabs', a.href); // required for restore on destroy
$.data(a, 'load.tabs', a.href); // mutable
- var id = self.tabId(a);
+ var id = self._tabId(a);
a.href = '#' + id;
var $panel = $('#' + id);
if (!$panel.length) {
@@ -323,7 +323,7 @@ $.widget("ui.tabs", {
var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label));
$li.data('destroy.tabs', true);
- var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] );
+ var id = url.indexOf('#') == 0 ? url.replace('#', '') : this._tabId( $('a:first-child', $li)[0] );
// try to find an existing element before creating a new one
var $panel = $('#' + id);
@@ -344,7 +344,7 @@ $.widget("ui.tabs", {
o.disabled = $.map(o.disabled,
function(n, i) { return n >= index ? ++n : n });
- this.tabify();
+ this._tabify();
if (this.$tabs.length == 1) {
$li.addClass(o.selectedClass);
@@ -369,7 +369,7 @@ $.widget("ui.tabs", {
o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
function(n, i) { return n >= index ? --n : n });
- this.tabify();
+ this._tabify();
// callback
this.trigger('remove', null, this.ui($li.find('a')[0], $panel[0]));