Started work on new navbar, just needs user count
This commit is contained in:
parent
17e256e038
commit
b9bfa5271e
3 changed files with 45 additions and 11 deletions
|
|
@ -145,11 +145,19 @@ class channel{
|
|||
this.user.permMap.chan = new Map(data.user.permMap.chan);
|
||||
|
||||
//If we can read the schedule
|
||||
if(client.user.permMap.chan.get('readSchedule')){
|
||||
if(this.user.permMap.chan.get('readSchedule')){
|
||||
//Display the queue icon
|
||||
this.chatBox.adminIcon.style.display = "";
|
||||
}
|
||||
|
||||
//If we can manage the channel
|
||||
if(this.user.permMap.chan.get('manageChannel')){
|
||||
//Unhide the channel settings button
|
||||
document.querySelector('.navbar-item#channel-settings-button-span').style.display = "";
|
||||
//Annoyingly, there isn't a good way in html to set a links relative filepath to use the current 'file' as a directory
|
||||
document.querySelector('.navbar-item#channel-settings-button-span a').href = `${document.URL}/settings`;
|
||||
}
|
||||
|
||||
//Tell the chatbox to handle client info
|
||||
//should it have its own event listener instead? Guess it's a stylistic choice :P
|
||||
this.chatBox.handleClientInfo(data);
|
||||
|
|
@ -218,6 +226,17 @@ class channel{
|
|||
return results;
|
||||
}
|
||||
|
||||
insertSettingsIcon(){
|
||||
const settingsIcon = document.createElement('i');
|
||||
settingsIcon.classList.add('navbar-item', 'bi-projector-fill');
|
||||
settingsIcon.id = "channel-settings-button";
|
||||
|
||||
//Insert settings icon into navbar
|
||||
document.querySelector('.navbar-item#logout-button').insertAdjacentElement('beforebegin', settingsIcon);
|
||||
//Insert icon seperator
|
||||
settingsIcon.insertAdjacentText('afterend', ' - ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes and applies default config on any unset settings
|
||||
* @param {Boolean} force - Whether or not to forcefully reset already set settings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue