]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Example implimentation 9008/head
authorauginator <amsevilla3@gmail.com>
Thu, 14 Jul 2016 21:03:04 +0000 (17:03 -0400)
committerauginator <amsevilla3@gmail.com>
Thu, 14 Jul 2016 21:03:04 +0000 (17:03 -0400)
– Fixed a derp in the mediaQuery is method’s conditional check for the
length of the string.
- Replaced atLeast() with new is() method in equalizer, tooltip and
sticky

js/foundation.equalizer.js
js/foundation.sticky.js
js/foundation.tooltip.js
js/foundation.util.mediaQuery.js

index f20f279f208399e514480384ab41c1c1e03d5edd..2ec93638f7a4ccd8d415f0fcf9a9228cfdbced0b 100644 (file)
@@ -87,7 +87,7 @@ class Equalizer {
    * @private
    */
   _checkMQ() {
-    var tooSmall = !Foundation.MediaQuery.atLeast(this.options.equalizeOn);
+    var tooSmall = !Foundation.MediaQuery.is(this.options.equalizeOn);
     if(tooSmall){
       if(this.isOn){
         this._pauseEvents();
index cfe356ffc219b722731831a803fe0d95f68701f9..9241bd7c23deb9a05dba09aa6383eef6db6cde74 100644 (file)
@@ -267,7 +267,7 @@ class Sticky {
    * @private
    */
   _setSizes(cb) {
-    this.canStick = Foundation.MediaQuery.atLeast(this.options.stickyOn);
+    this.canStick = Foundation.MediaQuery.is(this.options.stickyOn);
     if (!this.canStick) { cb(); }
     var _this = this,
         newElemWidth = this.$container[0].getBoundingClientRect().width,
index 2dc54b0ee7a8846ec230e2236bdc3da8469a21a6..b568e1ace4660cff69f0ffed16e36b94074b5206 100644 (file)
@@ -170,7 +170,7 @@ class Tooltip {
    * @function
    */
   show() {
-    if (this.options.showOn !== 'all' && !Foundation.MediaQuery.atLeast(this.options.showOn)) {
+    if (this.options.showOn !== 'all' && !Foundation.MediaQuery.is(this.options.showOn)) {
       // console.error('The screen is too small to display this tooltip');
       return false;
     }
index 298bd56acebd638ecb6285f8f30eeab5e6f65261..e69eaaadae5b878506d5648ff7bf16a5287d3e0d 100644 (file)
@@ -68,7 +68,7 @@ var MediaQuery = {
    */
   is(size) {
     size = size.trim().split(' ');
-    if(size.length > 0 && size[1] === 'only') {
+    if(size.length > 1 && size[1] === 'only') {
       if(size[0] === this._getCurrentSize()) return true;
     } else {
       return this.atLeast(size[0]);