]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
fix: error when switching ResponsiveAccordionTabs from tabs to accordion 12148/head
authorGregor <apriljunge@gmail.com>
Fri, 4 Sep 2020 20:05:20 +0000 (22:05 +0200)
committerGregor <apriljunge@gmail.com>
Fri, 4 Sep 2020 20:05:20 +0000 (22:05 +0200)
commit0866ce2301945fe0ea2d427daa08ba5cb4d8cd19
tree6bccf577e157e64732ecc24001d754c842681abf
parentdfc3e7873c98abce6c5bb224513cf3f9152d68ed
fix: error when switching ResponsiveAccordionTabs from tabs to accordion

When switching from tabs to accordion, the tabs instance gets destroyed.
Because destroying tabs and recalculating tabs height in  _setHeight method
rely on the foundatuion mediaquery event, both are executed.
Even if tabs instance got destroyed before.

This behaviour leads to an error in the _setHeight of tabs, because tabs markup is
already destroyed and $tabContent is null.

To prevent this, $tabcontent gets tested to be not falsy.

Closes #12106
js/foundation.tabs.js