From 7829aacb30843c37c1b601bb26607dc1f45b810d Mon Sep 17 00:00:00 2001 From: jk Date: Wed, 4 May 2016 22:39:54 +0200 Subject: [PATCH] cleanup PR - save var currentSize --- 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 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]); } }); } -- 2.47.2