Add Settings entry to the navigation drawer

This commit is contained in:
MrTimscampi 2020-03-22 21:09:10 +01:00
parent 9115a4e1fa
commit 3b9ca3c1a3

View File

@ -243,15 +243,20 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder" data-itemid="selectserver" href="selectserver.html?showuser=1"><i class="material-icons navMenuOptionIcon">wifi</i><span class="navMenuOptionText">' + globalize.translate("ButtonSelectServer") + "</span></a>";
}
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder btnSettings" data-itemid="settings" href="#"><i class="material-icons navMenuOptionIcon settings"></i><span class="navMenuOptionText">' + globalize.translate("ButtonSettings") + "</span></a>";
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder btnLogout" data-itemid="logout" href="#"><i class="material-icons navMenuOptionIcon exit_to_app"></i><span class="navMenuOptionText">' + globalize.translate("ButtonSignOut") + "</span></a>";
html += "</div>";
}
// add buttons to navigation drawer
navDrawerScrollContainer.innerHTML = html;
// bind logout button click to method
var btnLogout = navDrawerScrollContainer.querySelector(".btnLogout");
var btnSettings = navDrawerScrollContainer.querySelector(".btnSettings");
if (btnSettings) {
btnSettings.addEventListener("click", onSettingsClick);
}
var btnLogout = navDrawerScrollContainer.querySelector(".btnLogout");
if (btnLogout) {
btnLogout.addEventListener("click", onLogoutClick);
}
@ -598,6 +603,10 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
}
}
function onSettingsClick() {
Dashboard.navigate("mypreferencesmenu.html");
}
function onLogoutClick() {
Dashboard.logout();
}