From: zurbchris Date: Thu, 3 Dec 2015 07:02:17 +0000 (-0800) Subject: adds try/catch/finally block to foundation.reflow fn, fixes #7356 X-Git-Tag: v6.0.6~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba89d17de75f1cef09a135bad273bd0b5ee8b92d;p=thirdparty%2Ffoundation%2Ffoundation-sites.git adds try/catch/finally block to foundation.reflow fn, fixes #7356 --- diff --git a/js/foundation.core.js b/js/foundation.core.js index 4d964ac24..6a8d6ce1e 100644 --- a/js/foundation.core.js +++ b/js/foundation.core.js @@ -1,5 +1,4 @@ !function($) { - "use strict"; var FOUNDATION_VERSION = '6.0.5'; @@ -56,7 +55,7 @@ var Foundation = { var pluginName = functionName(plugin.constructor).toLowerCase(); plugin.uuid = this.GetYoDigits(6, pluginName); - + if(!plugin.$element.attr('data-' + pluginName)){ plugin.$element.attr('data-' + pluginName, plugin.uuid); } @@ -144,6 +143,7 @@ var Foundation = { * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything. */ reflow: function(elem, plugins) { + // If plugins is undefined, just grab everything if (typeof plugins === 'undefined') { plugins = Object.keys(this._plugins); @@ -179,7 +179,13 @@ var Foundation = { if(opt[0]) opts[opt[0]] = parseValue(opt[1]); }); } - $el.data('zf-plugin', new plugin($(this), opts)); + try{ + $el.data('zf-plugin', new plugin($(this), opts)); + }catch(er){ + console.error(er); + }finally{ + return; + } }); }); },