]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
cleanup PR - save var currentSize 8644/head
authorjk <j.koehler@modulingo.de>
Wed, 4 May 2016 20:39:54 +0000 (22:39 +0200)
committerjk <j.koehler@modulingo.de>
Wed, 4 May 2016 20:39:54 +0000 (22:39 +0200)
js/foundation.util.mediaQuery.js

index c5940ceba50ddb61af435c2eee0309eadd2b3016..53f8db6faa51f81b642f048f18cb1c585bece490 100644 (file)
@@ -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]);
       }
     });
   }