From ed2a1b9b9dc353be94608721e47baceee0bb8641 Mon Sep 17 00:00:00 2001 From: jk Date: Thu, 21 Apr 2016 01:26:42 +0200 Subject: [PATCH] changed.zf.mediaquery improvements this.current = newSize; (should be set before window triggered because if something goes wrong changed.zf.mediaquery fires constantly) --- js/foundation.util.mediaQuery.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]); } }); } -- 2.47.2