From 90d0dd85f435922998d04c84e8aae62c7774779e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Jakse?= Date: Mon, 13 Jul 2020 15:51:20 +0200 Subject: [PATCH] set input type=number when relevent --- public/alert.css | 2 +- public/alert.js | 5 +++-- public/trivabble.js | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/public/alert.css b/public/alert.css index 2b4c470..26ab339 100644 --- a/public/alert.css +++ b/public/alert.css @@ -35,7 +35,7 @@ padding:1ex } -.alert input[type=text], .alert input[type=password] { +.alert input[type=text], .alert input[type=number], .alert input[type=password] { border-radius:none; box-sizing:border-box; min-height:1.5rem; diff --git a/public/alert.js b/public/alert.js index 234d76c..2dc78d6 100644 --- a/public/alert.js +++ b/public/alert.js @@ -125,14 +125,15 @@ global.myAlert.l10n = _; - global.myPrompt = function (msg, callback, defaultText) { + global.myPrompt = function (msg, callback, defaultText, options) { if (!divAlert) { prepare(); } divAlertContent.textContent = msg; divAlertInput.style.display = ""; - divAlertInput.firstChild.value = defaultText || ""; + alertInput.value = defaultText || ""; + alertInput.type = (options && options.type) || "text"; divAlertConfirm.style.display = "none"; divAlertButton.style.display = "none"; divAlertCallback = callback; diff --git a/public/trivabble.js b/public/trivabble.js index 42884f6..a10be57 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -761,7 +761,8 @@ }]); } }, - row.lastChild.firstChild.textContent + row.lastChild.firstChild.textContent, + {type: "number"} ); }; } @@ -792,7 +793,8 @@ }]); } }, - row.lastChild.firstChild.textContent + row.lastChild.firstChild.textContent, + {type: "number"} ); }; } -- 2.30.2