mirror of
https://github.com/Michatec/MiniFaceBook.git
synced 2026-03-31 23:46:30 +02:00
- Added Gravatar Integration
- Realtime Notify & Notify API - Some bugs fixed
This commit is contained in:
20
static/js/adtab.js
Normal file
20
static/js/adtab.js
Normal file
@@ -0,0 +1,20 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var hash = window.location.hash;
|
||||
if (hash) {
|
||||
var tabTrigger = document.querySelector('#adminTab button[data-bs-target="' + hash + '"]');
|
||||
if (tabTrigger) {
|
||||
var tab = new bootstrap.Tab(tabTrigger);
|
||||
tab.show();
|
||||
}
|
||||
}
|
||||
|
||||
var triggerTabList = [].slice.call(document.querySelectorAll('#adminTab button'));
|
||||
triggerTabList.forEach(function (triggerEl) {
|
||||
triggerEl.addEventListener('shown.bs.tab', function (event) {
|
||||
var target = triggerEl.getAttribute('data-bs-target');
|
||||
if (target) {
|
||||
history.replaceState(null, null, target);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user