Skip to content
Browse files

Merge pull request #23 from patocallaghan/master

Infinite loop of resizeSlabs 'while' if parentWidth is 0
  • Loading branch information...
2 parents 260926b + 84c223e commit e692be963a07c5bdde74de438230460a4a597e92 @freqdec committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 js/jquery.slabtext.js
View
7 js/jquery.slabtext.js
@@ -78,6 +78,11 @@
// Cache the parent containers width
var parentWidth = $this.width(),
fs;
+
+ //Sanity check to prevent infinite loop
+ if ( parentWidth === 0 ) {
+ return;
+ }
// Remove the slabtextdone and slabtextinactive classnames to enable the inline-block shrink-wrap effect
$this.removeClass("slabtextdone slabtextinactive");
@@ -237,4 +242,4 @@
};
});
};
-})(jQuery);
+})(jQuery);

0 comments on commit e692be9

Please sign in to comment.
Something went wrong with that request. Please try again.