Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added sanity check to prevent infinite loop

Added sanity check to prevent infinite looping of the while loop if the parentWidth is 0, e.g. parent is "display: none".
  • Loading branch information...
commit 84c223eb82bd9b62adc14f455324699650ce2eb4 1 parent 260926b
@patocallaghan patocallaghan authored
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);
Please sign in to comment.
Something went wrong with that request. Please try again.