From: SassNinja Date: Thu, 24 Oct 2019 15:28:15 +0000 (+0200) Subject: fix: add reflow option in reflow to limit responsive accordion tabs fix X-Git-Tag: v6.6.0~1^2~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11885%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: add reflow option in reflow to limit responsive accordion tabs fix Without this adjustment the constructor of ResponsiveAccordionTabs always returns the transformed plugin (Accordion/Tab) and not ResponsiveAccordionTabs. This behavior is mostly only needed if the plugin gets initialized automatically. Otherwise all own methods of that plugin don't make much sense. --- diff --git a/js/foundation.core.js b/js/foundation.core.js index 8b7b88abe..18ceef959 100644 --- a/js/foundation.core.js +++ b/js/foundation.core.js @@ -156,8 +156,8 @@ var Foundation = { // For each plugin found, initialize it $elem.each(function() { var $el = $(this), - opts = {}; - + opts = { reflow: true }; + if($el.attr('data-options')){ var thing = $el.attr('data-options').split(';').forEach(function(e, i){ var opt = e.split(':').map(function(el){ return el.trim(); }); diff --git a/js/foundation.responsiveAccordionTabs.js b/js/foundation.responsiveAccordionTabs.js index 448cc72de..0233d9f89 100644 --- a/js/foundation.responsiveAccordionTabs.js +++ b/js/foundation.responsiveAccordionTabs.js @@ -38,7 +38,7 @@ var MenuPlugins = { class ResponsiveAccordionTabs extends Plugin{ constructor(element, options) { super(element, options); - return this.storezfData || this; + return this.options.reflow && this.storezfData || this; } /**