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

make auto saving conditional

This commit is contained in:
Luke Pulverenti 2016-01-06 15:11:32 -05:00
parent 24a456b877
commit 9fb1452f93
7 changed files with 90 additions and 11 deletions

View file

@ -96,7 +96,7 @@
AppSettings.enableCinemaMode(page.querySelector('.chkEnableCinemaMode').checked);
ApiClient.updateUserConfiguration(user.Id, user.Configuration);
return ApiClient.updateUserConfiguration(user.Id, user.Configuration);
}
function save(page) {
@ -113,9 +113,22 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
if (!AppInfo.enableAutoSave) {
Dashboard.showLoadingMsg();
}
ApiClient.getUser(userId).then(function (result) {
saveUser(page, result);
saveUser(page, result).then(function () {
Dashboard.hideLoadingMsg();
if (!AppInfo.enableAutoSave) {
Dashboard.alert(Globalize.translate('SettingsSaved'));
}
}, function () {
Dashboard.hideLoadingMsg();
});
});
}
@ -141,6 +154,12 @@
});
$('.languagePreferencesForm').off('submit', onSubmit).on('submit', onSubmit);
if (AppInfo.enableAutoSave) {
page.querySelector('.btnSave').classList.add('hide');
} else {
page.querySelector('.btnSave').classList.remove('hide');
}
});
pageIdOn('pageshow', "languagePreferencesPage", function () {
@ -168,7 +187,9 @@
var page = this;
save(page);
if (AppInfo.enableAutoSave) {
save(page);
}
});
})(jQuery, window, document);