diff options
author | Klaus Hartl <klaus.hartl@googlemail.com> | 2009-02-28 22:10:30 +0000 |
---|---|---|
committer | Klaus Hartl <klaus.hartl@googlemail.com> | 2009-02-28 22:10:30 +0000 |
commit | a02ac5f3721c14b2a20c29cdc7ddefc460a9f308 (patch) | |
tree | bfe785781718afb35e77de2badac2180282a6424 /ui | |
parent | 517d5ab62ca98da1eb2ed8d241b305fc21f88581 (diff) | |
download | jquery-ui-a02ac5f3721c14b2a20c29cdc7ddefc460a9f308.tar.gz jquery-ui-a02ac5f3721c14b2a20c29cdc7ddefc460a9f308.zip |
Tabs: fixed stopping a rotation
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.tabs.js | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js index 2a7b30a40..cfbdbd4a8 100644 --- a/ui/ui.tabs.js +++ b/ui/ui.tabs.js @@ -639,29 +639,30 @@ $.extend($.ui.tabs.prototype, { var self = this, o = this.options, t = o.selected; - function rotate() { + var rotate = function() { clearTimeout(self.rotation); self.rotation = setTimeout(function() { t = ++t < self.anchors.length ? t : 0; self.select(t); }, ms); - } + }; + + var stop = !continuing ? + function(e) { + if (e.clientX) { // in case of a true click + clearTimeout(self.rotation); + self.element.unbind('tabsshow', rotate); + } + } : + function(e) { + t = o.selected; + rotate(); + }; // start rotation if (ms) { this.element.bind('tabsshow', rotate); // will not be attached twice - this.anchors.bind(o.event + '.tabs', !continuing ? - function(e) { - if (e.clientX) { // in case of a true click - clearTimeout(self.rotation); - self.element.unbind('tabsshow', rotate); - } - } : - function(e) { - t = o.selected; - rotate(); - } - ); + this.anchors.bind(o.event + '.tabs', stop); rotate(); } // stop rotation |