See: https://github.com/zurb/foundation-sites/pull/11006#issuecomment-
370193395
Previous PR: https://github.com/zurb/foundation-sites/pull/11006 (@DanielRuf)
Closes https://github.com/zurb/foundation-sites/issues/10771 (@hubert-ried)
}
});
if(this.options.deepLink) {
- $(window).on('popstate', this._checkDeepLink);
+ $(window).on('hashchange', this._checkDeepLink);
}
}
this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
this.$element.find('a').off('.zf.accordion');
if(this.options.deepLink) {
- $(window).off('popstate', this._checkDeepLink);
+ $(window).off('hashchange', this._checkDeepLink);
}
}
}
};
- $(window).on('popstate', this._deepLinkScroll);
+ $(window).on('hashchange', this._deepLinkScroll);
}
/**
var hash = this.$active[0].getAttribute('href');
window.location.hash.replace(hash, '');
}
- $(window).off('popstate', this._deepLinkScroll);
+ $(window).off('hashchange', this._deepLinkScroll);
}
}
});
}
if (this.options.deepLink) {
- $(window).on(`popstate.zf.reveal:${this.id}`, this._handleState.bind(this));
+ $(window).on(`hashchange.zf.reveal:${this.id}`, this._handleState.bind(this));
}
}
/**
- * Handles modal methods on back/forward button clicks or any other event that triggers popstate.
+ * Handles modal methods on back/forward button clicks or any other event that triggers hashchange.
* @private
*/
_handleState(e) {
}
}
- //current context-bound function to open tabs on page load or history popstate
+ //current context-bound function to open tabs on page load or history hashchange
this._checkDeepLink = () => {
var anchor = window.location.hash;
//need a hash and a relevant anchor in this tabset
}
if(this.options.deepLink) {
- $(window).on('popstate', this._checkDeepLink);
+ $(window).on('hashchange', this._checkDeepLink);
}
}
}
if (this.options.deepLink) {
- $(window).off('popstate', this._checkDeepLink);
+ $(window).off('hashchange', this._checkDeepLink);
}
}