From: maks feltrin Date: Mon, 29 Aug 2016 23:36:33 +0000 (+0200) Subject: check if cb is a function X-Git-Tag: v6.2.4-rc1~29^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9210%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git check if cb is a function --- diff --git a/js/foundation.util.timerAndImageLoader.js b/js/foundation.util.timerAndImageLoader.js index b5facd02f..2e9f9e673 100644 --- a/js/foundation.util.timerAndImageLoader.js +++ b/js/foundation.util.timerAndImageLoader.js @@ -29,7 +29,7 @@ function Timer(elem, options, cb) { if(options.infinite){ _this.restart();//rerun the timer. } - cb(); + if (cb && typeof cb === 'function') { cb(); } }, remain); elem.trigger(`timerstart.zf.${nameSpace}`); }