From: Nicolas Coden Date: Wed, 29 Aug 2018 21:57:57 +0000 (+0200) Subject: fix: fix initial state for Accordion without any panel active X-Git-Tag: v6.6.0~3^2~96^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=314b4ee53204b79ffeb53e9c54197bab404fdc5d;p=thirdparty%2Ffoundation%2Ffoundation-sites.git 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". --- 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; } /**