From: jk Date: Wed, 4 May 2016 20:39:54 +0000 (+0200) Subject: cleanup PR - save var currentSize X-Git-Tag: v6.2.2-rc1~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7829aacb30843c37c1b601bb26607dc1f45b810d;p=thirdparty%2Ffoundation%2Ffoundation-sites.git cleanup PR - save var currentSize --- diff --git a/js/foundation.util.mediaQuery.js b/js/foundation.util.mediaQuery.js index c5940ceba..53f8db6fa 100644 --- a/js/foundation.util.mediaQuery.js +++ b/js/foundation.util.mediaQuery.js @@ -106,14 +106,14 @@ var MediaQuery = { */ _watcher() { $(window).on('resize.zf.mediaquery', () => { - var newSize = this._getCurrentSize(); + var newSize = this._getCurrentSize(), currentSize = this.current; - if (newSize !== this.current) { + if (newSize !== currentSize) { // Change the current media query this.current = newSize; // Broadcast the media query change on the window - $(window).trigger('changed.zf.mediaquery', [newSize, this.current]); + $(window).trigger('changed.zf.mediaquery', [newSize, currentSize]); } }); }