aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-02-04 17:18:21 +0100
committerVincent Petry <pvince81@owncloud.com>2016-02-04 17:18:21 +0100
commitd4da2f0ac717235e57db095cdf3e7f328996ba4c (patch)
treea2891e331b2fbc388959cfc8c1c60fca633f17f9 /apps/files_external/js
parentd83b1f3b8b2941a0a608a17527bf3b20f6b60407 (diff)
downloadnextcloud-server-d4da2f0ac717235e57db095cdf3e7f328996ba4c.tar.gz
nextcloud-server-d4da2f0ac717235e57db095cdf3e7f328996ba4c.zip
Improve credentials dialog usability a bit
Automatically focus on the first field. Pressing enter submits the form.
Diffstat (limited to 'apps/files_external/js')
-rw-r--r--apps/files_external/js/statusmanager.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js
index ed9a0ba1a90..33d2ea104be 100644
--- a/apps/files_external/js/statusmanager.js
+++ b/apps/files_external/js/statusmanager.js
@@ -421,12 +421,12 @@ OCA.External.StatusManager = {
OC.Notification.showTemporary(t('files_external', 'Credentials saving failed'));
}
});
+ return false;
};
- dialog.find('form').on('submit', apply);
-
var ocdialogParams = {
modal: true,
+ title: t('files_external', 'Credentials required'),
buttons: [{
text: t('files_external', 'Save'),
click: apply,
@@ -439,6 +439,17 @@ OCA.External.StatusManager = {
.bind('ocdialogclose', function () {
dialog.ocdialog('destroy').remove();
});
+
+ dialog.find('form').on('submit', apply);
+ dialog.find('form input:first').focus();
+ dialog.find('form input').keyup(function (e) {
+ if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) {
+ $(e.target).closest('form').submit();
+ return false;
+ } else {
+ return true;
+ }
+ });
}
};