From 314b4ee53204b79ffeb53e9c54197bab404fdc5d Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Wed, 29 Aug 2018 23:57:57 +0200 Subject: [PATCH] fix: fix initial state for Accordion without any panel active When going back in history, the Accordion without any panel active is still considered as in its "initial state". --- js/foundation.accordion.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/foundation.accordion.js b/js/foundation.accordion.js index f5c22f7de..f558505c8 100644 --- a/js/foundation.accordion.js +++ b/js/foundation.accordion.js @@ -61,6 +61,10 @@ class Accordion extends Plugin { }); var $initActive = this.$element.find('.is-active').children('[data-tab-content]'); + // Remember if we already set up the initial state of the Accordion as it + // gives additional privileges in the Accordion methods (like opening + // multiple panels even with the "multiExpand" option is disabled) + // TODO: refactor and clean this this.firstTimeInit = true; if ($initActive.length) { // Save up the initial hash to return to it later when going back in history @@ -113,6 +117,7 @@ class Accordion extends Plugin { } this._events(); + this.firstTimeInit = false; } /** -- 2.47.2