disable: this._scrollDisable.bind(this),
setup: this._scrollEnable.bind(this, true)
});
+
+ window.addEventListener('hashchange', function () {
+ var hash = window.location.hash.replace(/^#/, '');
+ var element = (hash) ? elById(hash) : null;
+ if (element !== null && element.classList.contains('tabMenuContent')) {
+ _tabMenus.forEach(function (tabMenu) {
+ if (tabMenu.hasTab(hash)) {
+ tabMenu.select(hash);
+ }
+ });
+ }
+ });
},
/**
this.init(oldTabs);
},
+ /**
+ * Returns true if this tab menu has a tab with provided name.
+ *
+ * @param {string} name tab name
+ * @return {boolean} true if tab name matches
+ */
+ hasTab: function (name) {
+ return this._tabs.has(name);
+ },
+
/**
* Handles clicks on a tab.
*