0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-20 17:54:23 +01:00

clear interval in cycle + rebuild

This commit is contained in:
fat 2013-02-05 20:34:39 -08:00
parent 566380b257
commit a866a51a2e
6 changed files with 19 additions and 15 deletions

View File

@ -39,6 +39,7 @@
cycle: function (e) { cycle: function (e) {
if (!e) this.paused = false if (!e) this.paused = false
if (this.interval) clearInterval(this.interval);
this.options.interval this.options.interval
&& !this.paused && !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))

View File

@ -156,10 +156,10 @@
* =================================== */ * =================================== */
$(document) $(document)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) .on('click.dropdown.data-api', clearMenus)
.on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) .on('.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}(window.jQuery); }(window.jQuery);

View File

@ -212,7 +212,7 @@
, getPosition: function () { , getPosition: function () {
var el = this.$element[0] var el = this.$element[0]
return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : { return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
width: el.offsetWidth width: el.offsetWidth
, height: el.offsetHeight , height: el.offsetHeight
}, this.$element.offset()) }, this.$element.offset())

View File

@ -300,6 +300,7 @@
cycle: function (e) { cycle: function (e) {
if (!e) this.paused = false if (!e) this.paused = false
if (this.interval) clearInterval(this.interval);
this.options.interval this.options.interval
&& !this.paused && !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
@ -788,13 +789,14 @@
* =================================== */ * =================================== */
$(document) $(document)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) .on('click.dropdown.data-api', clearMenus)
.on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) .on('.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}(window.jQuery);/* ========================================================= }(window.jQuery);
/* =========================================================
* bootstrap-modal.js v2.3.0 * bootstrap-modal.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#modals * http://twitter.github.com/bootstrap/javascript.html#modals
* ========================================================= * =========================================================
@ -1252,7 +1254,7 @@
, getPosition: function () { , getPosition: function () {
var el = this.$element[0] var el = this.$element[0]
return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : { return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
width: el.offsetWidth width: el.offsetWidth
, height: el.offsetHeight , height: el.offsetHeight
}, this.$element.offset()) }, this.$element.offset())

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,7 @@
cycle: function (e) { cycle: function (e) {
if (!e) this.paused = false if (!e) this.paused = false
if (this.interval) clearInterval(this.interval);
this.options.interval this.options.interval
&& !this.paused && !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))