1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

userpassword.js

This commit is contained in:
grafixeyehero 2019-10-08 01:30:02 +03:00
parent 5ebf1bda80
commit 678b558935

View file

@ -1,20 +1,30 @@
define(["jQuery", "loading", "libraryMenu"], function($, loading, libraryMenu) { define(["jQuery", "loading", "libraryMenu"], function ($, loading, libraryMenu) {
"use strict"; "use strict";
function loadUser(page, user) { function loadUser(page, user) {
libraryMenu.setTitle(user.Name), "Guest" == user.ConnectLinkType ? $(".connectMessage", page).show() : $(".connectMessage", page).hide(), loading.hide() libraryMenu.setTitle(user.Name);
if ("Guest" == user.ConnectLinkType) {
$(".connectMessage", page).show();
} else {
$(".connectMessage", page).hide();
}
loading.hide();
} }
function loadData(page) { function loadData(page) {
loading.show(); loading.show();
var userId = getParameterByName("userId"); var userId = getParameterByName("userId");
ApiClient.getUser(userId).then(function(user) { ApiClient.getUser(userId).then(function (user) {
loadUser(page, user) loadUser(page, user);
}) });
} }
$(document).on("pageinit", "#userPasswordPage", function() {
$(".adminUpdatePasswordForm").off("submit", UpdatePasswordPage.onSubmit).on("submit", UpdatePasswordPage.onSubmit), $(".adminLocalAccessForm").off("submit", UpdatePasswordPage.onLocalAccessSubmit).on("submit", UpdatePasswordPage.onLocalAccessSubmit) $(document).on("pageinit", "#userPasswordPage", function () {
}).on("pagebeforeshow", "#userPasswordPage", function() { $(".adminUpdatePasswordForm").off("submit", UpdatePasswordPage.onSubmit).on("submit", UpdatePasswordPage.onSubmit);
loadData(this) $(".adminLocalAccessForm").off("submit", UpdatePasswordPage.onLocalAccessSubmit).on("submit", UpdatePasswordPage.onLocalAccessSubmit);
}) }).on("pagebeforeshow", "#userPasswordPage", function () {
}); loadData(this);
});
});