mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tabs: fixed stopping a rotation
This commit is contained in:
parent
517d5ab62c
commit
a02ac5f372
@ -639,29 +639,30 @@ $.extend($.ui.tabs.prototype, {
|
|||||||
|
|
||||||
var self = this, o = this.options, t = o.selected;
|
var self = this, o = this.options, t = o.selected;
|
||||||
|
|
||||||
function rotate() {
|
var rotate = function() {
|
||||||
clearTimeout(self.rotation);
|
clearTimeout(self.rotation);
|
||||||
self.rotation = setTimeout(function() {
|
self.rotation = setTimeout(function() {
|
||||||
t = ++t < self.anchors.length ? t : 0;
|
t = ++t < self.anchors.length ? t : 0;
|
||||||
self.select(t);
|
self.select(t);
|
||||||
}, ms);
|
}, 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
|
// start rotation
|
||||||
if (ms) {
|
if (ms) {
|
||||||
this.element.bind('tabsshow', rotate); // will not be attached twice
|
this.element.bind('tabsshow', rotate); // will not be attached twice
|
||||||
this.anchors.bind(o.event + '.tabs', !continuing ?
|
this.anchors.bind(o.event + '.tabs', stop);
|
||||||
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();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
rotate();
|
rotate();
|
||||||
}
|
}
|
||||||
// stop rotation
|
// stop rotation
|
||||||
|
Loading…
Reference in New Issue
Block a user