From e0991f764deed9977c35d9af651daaa3132aef3e Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Sat, 24 Aug 2013 13:00:57 -0400 Subject: [PATCH] throw error if no mode --- isotope.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isotope.js b/isotope.js index dc005ef..c1751db 100644 --- a/isotope.js +++ b/isotope.js @@ -81,7 +81,11 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, layoutMode }; Isotope.prototype._mode = function() { - return this.modes[ this.options.layoutMode ]; + var mode = this.modes[ this.options.layoutMode ]; + if ( !mode ) { + throw new Error( 'No layout mode: ' + this.options.layoutMode ); + } + return mode; }; Isotope.prototype.layout = function() {