* @private
*/
_init() {
+ this._isInitializing = true;
+
this.$element.attr('role', 'tablist');
this.$tabs = this.$element.children('[data-accordion-item]');
this._checkDeepLink = () => {
var anchor = window.location.hash;
- // If there is no anchor, return to the initial panel
- if (!anchor.length && this._initialAnchor) {
- anchor = this._initialAnchor;
+ if (!anchor.length) {
+ // If we are still initializing and there is no anchor, then there is nothing to do
+ if (this._isInitializing) return;
+ // Otherwise, move to the initial anchor
+ if (this._initialAnchor) anchor = this._initialAnchor;
}
var $anchor = anchor && $(anchor);
}
this._events();
+
+ this._isInitializing = false;
}
/**
*/
_init() {
var _this = this;
+ this._isInitializing = true;
this.$element.attr({'role': 'tablist'});
this.$tabTitles = this.$element.find(`.${this.options.linkClass}`);
this._checkDeepLink = () => {
var anchor = window.location.hash;
- // If there is no anchor, return to the initial panel
- if (!anchor.length && this._initialAnchor) {
- anchor = this._initialAnchor;
+ if (!anchor.length) {
+ // If we are still initializing and there is no anchor, then there is nothing to do
+ if (this._isInitializing) return;
+ // Otherwise, move to the initial anchor
+ if (this._initialAnchor) anchor = this._initialAnchor;
}
var anchorNoHash = anchor.indexOf('#') >= 0 ? anchor.slice(1) : anchor;
}
this._events();
+
+ this._isInitializing = false;
}
/**