From 55e563cd673db33329c0a0d5aa77b41f9c9ed716 Mon Sep 17 00:00:00 2001 From: SassNinja Date: Thu, 24 Oct 2019 17:28:15 +0200 Subject: [PATCH] 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. --- js/foundation.core.js | 4 ++-- js/foundation.responsiveAccordionTabs.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; } /** -- 2.47.2