Switch to using icons when rendering a DN, and move the server icons to the topmenu
This commit is contained in:
@@ -48,23 +48,11 @@
|
||||
var subpage = window.location.hash;
|
||||
|
||||
$(document).ready(function() {
|
||||
// Enable navigating to a page via a URL fragment, and that fragment is defined with a server-icon
|
||||
if (subpage) {
|
||||
// Enable navigating to a page via a URL fragment, and that fragment is defined with a server-icon
|
||||
var valid = Object.values($('.server-icon > a').map(function() {
|
||||
return $(this).attr('id');
|
||||
})).indexOf(subpage.substring(1));
|
||||
|
||||
if (valid !== -1) {
|
||||
// @todo this condition can probably be removed
|
||||
console.log('teleporting...:'+subpage.substring(1));
|
||||
// The click() event wont have been registered yet, so we need to delay us clicking it
|
||||
setTimeout(function() { $(subpage).click(); },250);
|
||||
|
||||
} else if (valid === -1) {
|
||||
// Clear the hash
|
||||
history.replaceState(null,null,' ');
|
||||
getNode(subpage.substring(1));
|
||||
}
|
||||
// Clear the hash
|
||||
history.replaceState(null,null,' ');
|
||||
getNode(subpage.substring(1));
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user