From: jk Date: Wed, 20 Apr 2016 23:26:42 +0000 (+0200) Subject: changed.zf.mediaquery improvements X-Git-Tag: v6.2.2-rc1~6^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed2a1b9b9dc353be94608721e47baceee0bb8641;p=thirdparty%2Ffoundation%2Ffoundation-sites.git changed.zf.mediaquery improvements this.current = newSize; (should be set before window triggered because if something goes wrong changed.zf.mediaquery fires constantly) --- diff --git a/js/foundation.util.mediaQuery.js b/js/foundation.util.mediaQuery.js index baa1f0b87..c5940ceba 100644 --- a/js/foundation.util.mediaQuery.js +++ b/js/foundation.util.mediaQuery.js @@ -109,11 +109,11 @@ var MediaQuery = { var newSize = this._getCurrentSize(); if (newSize !== this.current) { - // Broadcast the media query change on the window - $(window).trigger('changed.zf.mediaquery', [newSize, this.current]); - // Change the current media query this.current = newSize; + + // Broadcast the media query change on the window + $(window).trigger('changed.zf.mediaquery', [newSize, this.current]); } }); }