PSFPortal/app/util/navigation.js
Chord fa6e168ccc Application improvements
* Change favicon
* Display account banned status on admin search
* Pull in application version from Webpack
* Add "Feedback" button in footer and github references
* Fix faction icons to make them the same size
* PaginatedList component now supports back
* Tabbed navs support back
* Hide Pagination when only one page
* Improve admin table style and size
2019-12-31 09:46:34 -05:00

20 lines
426 B
JavaScript

import jq from 'jquery'
export function monitor_tabs(callback) {
jq('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var hash = jq(e.target).attr('href');
if (callback)
callback(hash);
if (history.pushState) {
history.replaceState(null, null, hash);
} else {
location.hash = hash;
}
});
var hash = window.location.hash;
if (hash) {
jq('.nav-link[href="' + hash + '"]').tab('show');
}
}