add suggested changes to improve formatting

Co-Authored-By: dkanada <dkanada@users.noreply.github.com>
This commit is contained in:
Vasily 2019-01-20 00:42:48 +09:00 committed by dkanada
parent fe54e713f3
commit db52db1968
3 changed files with 19 additions and 9 deletions

View File

@ -16,15 +16,27 @@ define(["apphost", "connectionManager", "listViewStyle", "emby-linkbutton"], fun
page.querySelector(".lnkHomeScreenPreferences").setAttribute("href", "mypreferenceshome.html?userId=" + userId);
page.querySelector(".lnkMyProfile").setAttribute("href", "myprofile.html?userId=" + userId);
appHost.supports("multiserver") ? page.querySelector(".selectServer").classList.remove("hide") : page.querySelector(".selectServer").classList.add("hide");
if (appHost.supports("multiserver")) {
page.querySelector(".selectServer").classList.remove("hide")
} else {
page.querySelector(".selectServer").classList.add("hide");
}
connectionManager.user(ApiClient).then(function(user) {
user.localUser && !user.localUser.EnableAutoLogin ? view.querySelector(".btnLogout").classList.remove("hide") : view.querySelector(".btnLogout").classList.add("hide");
if (user.localUser && !user.localUser.EnableAutoLogin) {
view.querySelector(".btnLogout").classList.remove("hide");
} else {
view.querySelector(".btnLogout").classList.add("hide");
}
});
Dashboard.getCurrentUser().then(function(user) {
page.querySelector(".headerUser").innerHTML = user.Name;
user.Policy.IsAdministrator ? page.querySelector(".adminSection").classList.remove("hide") : page.querySelector(".adminSection").classList.add("hide");
if (user.Policy.IsAdministrator) {
page.querySelector(".adminSection").classList.remove("hide");
} else {
page.querySelector(".adminSection").classList.add("hide");
}
});
})
}
});
});

View File

@ -122,7 +122,7 @@ define(["loading", "appRouter", "layoutManager", "appSettings", "apphost", "focu
var isRestored = e.detail.isRestored;
appRouter.setTitle(null);
backdrop.setBackdrop(backdropUrl);
isRestored || loadServers();
if (!isRestored) loadServers();
}), view.querySelector(".servers").addEventListener("click", function(e) {
var card = dom.parentWithClass(e.target, "card");
if (card) {

View File

@ -307,11 +307,9 @@ var Dashboard = {
: browser.msie
? define("registerElement", [bowerPath + "/webcomponentsjs/webcomponents-lite.min.js"], returnFirstDependency)
: define("registerElement", [bowerPath + "/document-register-element/build/document-register-element"], returnFirstDependency);
"android" === self.appMode
"cordova" === self.appMode || "android" === self.appMode
? define("serverdiscovery", ["cordova/serverdiscovery"], returnFirstDependency)
: "cordova" === self.appMode
? define("serverdiscovery", ["cordova/serverdiscovery"], returnFirstDependency)
: define("serverdiscovery", [apiClientBowerPath + "/serverdiscovery"], returnFirstDependency);
: define("serverdiscovery", [apiClientBowerPath + "/serverdiscovery"], returnFirstDependency);
"cordova" === self.appMode && browser.iOSVersion && browser.iOSVersion < 11
? define("imageFetcher", ["cordova/imagestore"], returnFirstDependency)
: define("imageFetcher", [embyWebComponentsBowerPath + "/images/basicimagefetcher"], returnFirstDependency);