From: Alexander Ebert Date: Fri, 24 Apr 2015 14:28:43 +0000 (+0200) Subject: Some improvements to WCF.PeriodicalExecuter X-Git-Tag: 2.1.4~57 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=032b6044c58cdcd2336987cd327f419d2dbb4cdf;p=GitHub%2FWoltLab%2FWCF.git Some improvements to WCF.PeriodicalExecuter --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 26587cd3fc..31486786d7 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2410,13 +2410,33 @@ WCF.PeriodicalExecuter = Class.extend({ /** * Resumes the interval-based callback execution. + * + * @deprecated 2.1 - use restart() instead */ resume: function() { + this.restart(); + }, + + /** + * Restarts the interval-based callback execution. + */ + restart: function() { if (this._intervalID) { this.stop(); } this._intervalID = setInterval($.proxy(this._execute, this), this._interval); + }, + + /** + * Sets the interval and restarts the interval. + * + * @param integer interval + */ + setInterval: function(interval) { + this._interval = interval; + + this.restart(); } });