Commit a866a51a authored by fat's avatar fat
Browse files

clear interval in cycle + rebuild

parent 566380b2
1 merge request!6821Typeahead updater
Showing with 19 additions and 15 deletions
+19 -15
...@@ -39,6 +39,7 @@ ...@@ -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))
......
...@@ -156,10 +156,10 @@ ...@@ -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);
\ No newline at end of file
...@@ -212,7 +212,7 @@ ...@@ -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())
......
...@@ -300,6 +300,7 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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())
......
This diff is collapsed.
...@@ -39,6 +39,7 @@ ...@@ -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))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment