From cbd29794b85606734c062baf127c4ddcaad69685 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 8 Mar 2018 12:16:40 +0100 Subject: [PATCH] Improve keyboard shortcuts in the pad creation screen --- www/common/common-ui-elements.js | 16 ++++++++++++++-- www/settings/inner.js | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 15e3c7b8c..5239f43f7 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1804,6 +1804,7 @@ define([ }; // Owned pads + // Default is Owned pad var owned = h('div.cp-creation-owned', [ h('h2', [ Messages.creation_ownedTitle, @@ -1829,7 +1830,7 @@ define([ ]); $creation.append(owned); - // If set to "open pad" or not set, check "open pad" + // If set to "open pad", check "open pad" if (!cfg.owned && typeof cfg.owned !== "undefined") { $creation.find('#cp-creation-owned-false').attr('checked', true); } @@ -1877,6 +1878,16 @@ define([ ]) ]); $creation.append(expire); + $creation.find('#cp-creation-expire-val').keydown(function (e) { + if (e.which === 9) { + e.stopPropagation(); + } + }); + $creation.find('#cp-creation-expire-unit').keydown(function (e) { + if (e.which === 9 && e.shiftKey) { + e.stopPropagation(); + } + }); UIElements.setExpirationValue(cfg.expire, $creation); @@ -1945,6 +1956,7 @@ define([ }); var $button = $('