]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: add _reinit method to cover case when CSS is loaded too late
authorSassNinja <kai.falkowski@gmail.com>
Thu, 18 Oct 2018 08:45:39 +0000 (10:45 +0200)
committerSassNinja <kai.falkowski@gmail.com>
Thu, 18 Oct 2018 08:45:39 +0000 (10:45 +0200)
js/foundation.util.mediaQuery.js

index 5d0ffd40cd5fdcd99a3a56fdde9203ff0a61ace8..69abbc645c2bc6eacdfcd1d959f9969a97cec0f1 100644 (file)
@@ -113,6 +113,16 @@ var MediaQuery = {
     this._watcher();
   },
 
+  /**
+   * Reinitializes the media query helper what might be necessary if your CSS is not (completely) loaded while _init() is executed.
+   * @function
+   * @private
+   */
+  _reinit() {
+    this.isInitialized = false;
+    this._init();
+  },
+
   /**
    * Checks if the screen is at least as wide as a breakpoint.
    * @function