summaryrefslogtreecommitdiffstats
path: root/apps/theming/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-27 20:46:12 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-27 20:46:12 +0200
commitcd74ad55e4b86f47bc64e797dec909d2cfb30780 (patch)
treef93a729011a3b71278beeca5431a4204be8a3e5c /apps/theming/js
parenta08c4a2b13c186464c65513eed26b2a008bf1986 (diff)
downloadnextcloud-server-cd74ad55e4b86f47bc64e797dec909d2cfb30780.tar.gz
nextcloud-server-cd74ad55e4b86f47bc64e797dec909d2cfb30780.zip
Only save when value changed or enter is pressed
Diffstat (limited to 'apps/theming/js')
-rw-r--r--apps/theming/js/settings-admin.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js
index 916e1ec32e9..bd4b4b34ed1 100644
--- a/apps/theming/js/settings-admin.js
+++ b/apps/theming/js/settings-admin.js
@@ -86,28 +86,34 @@ $(document).ready(function () {
$('#uploadlogo').fileupload(uploadParamsLogo);
$('#upload-login-background').fileupload(uploadParamsLogin);
- $('#theming-name').keyup(function (e) {
+ $('#theming-name').change(function(e) {
+ var el = $(this);
+ $.when(el.focusout()).then(function() {
+ setThemingValue('name', $(this).val());
+ });
if (e.keyCode == 13) {
setThemingValue('name', $(this).val());
}
- }).focusout(function (e) {
- setThemingValue('name', $(this).val());
});
- $('#theming-url').keyup(function (e) {
+ $('#theming-url').change(function(e) {
+ var el = $(this);
+ $.when(el.focusout()).then(function() {
+ setThemingValue('url', $(this).val());
+ });
if (e.keyCode == 13) {
setThemingValue('url', $(this).val());
}
- }).focusout(function (e) {
- setThemingValue('url', $(this).val());
});
- $('#theming-slogan').keyup(function (e) {
+ $('#theming-slogan').change(function(e) {
+ var el = $(this);
+ $.when(el.focusout()).then(function() {
+ setThemingValue('slogan', $(this).val());
+ });
if (e.keyCode == 13) {
setThemingValue('slogan', $(this).val());
}
- }).focusout(function (e) {
- setThemingValue('slogan', $(this).val());
});
$('#theming-color').change(function (e) {