feat: ctrl-s now saves on settingsv1/v2 forms

... because nobody ever uses ctrl-s on a browser window.
v1.18.x
Julian Lam 4 years ago
parent dc0a4a49b7
commit 8093142340

@ -1,7 +1,7 @@
'use strict';
define('admin/settings', ['uploader'], function (uploader) {
define('admin/settings', ['uploader', 'mousetrap'], function (uploader, mousetrap) {
var Settings = {};
Settings.init = function () {
@ -90,6 +90,11 @@ define('admin/settings', ['uploader'], function (uploader) {
});
});
mousetrap.bind('ctrl+s', function (ev) {
saveBtn.click();
ev.preventDefault();
});
handleUploads();
setupTagsInput();

@ -509,6 +509,16 @@ define('settings', function () {
app.flags._unsaved = true;
});
var saveEl = document.getElementById('save');
if (saveEl) {
require(['mousetrap'], function (mousetrap) {
mousetrap.bind('ctrl+s', function (ev) {
saveEl.click();
ev.preventDefault();
});
});
}
callback(null, values);
});
},

Loading…
Cancel
Save