From ca53080e7a9ddc37d84cb4323e1e069705cbc731 Mon Sep 17 00:00:00 2001 From: Marcus Jaschen Date: Tue, 23 Mar 2021 09:45:35 +0100 Subject: [PATCH] auto-focus primary button in "delete route" dialog (#387) After opening the "delete route" dialog the primary action button gets the current focus. So it's possible to confirm resetting the route by pressing "Enter". bootbox had to be updated to to achieve this (in prior versions of bootbox the needed callback didn't exist). see #385 --- js/index.js | 3 +++ package.json | 2 +- yarn.lock | 36 +++++++++++++++++++++++------------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/js/index.js b/js/index.js index aaa7037..2ef465b 100644 --- a/js/index.js +++ b/js/index.js @@ -153,6 +153,9 @@ }, ], value: ['route'], + onShown: function () { + $('button.bootbox-accept', $(this)).focus(); + }, callback: function (result) { if (result !== null) { if (result.indexOf('route') !== -1) { diff --git a/package.json b/package.json index fc5897a..f1f273e 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@turf/turf": "^6.2.0", "Leaflet.vector-markers": "nrenner/Leaflet.vector-markers#2ef80c9", "async": "~0.9.2", - "bootbox": "~5.3.4", + "bootbox": "~5.5.2", "bootstrap": "4.3.1", "bootstrap-select": "1.13.18", "bootstrap-slider": "^9.8.1", diff --git a/yarn.lock b/yarn.lock index 4ed4474..faaecb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2998,14 +2998,14 @@ blob@0.0.5: resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== -bootbox@~5.3.4: - version "5.3.4" - resolved "https://registry.yarnpkg.com/bootbox/-/bootbox-5.3.4.tgz#03064346c79c019708500dab679341645bb10952" - integrity sha512-odUj3HCaIfaSltAyfCRuPavruQKvpluTihyCbJ1bvRdAi7P2/bEbcjWMkTSonaHC+QjnrQfO1Px6863fJ13//A== +bootbox@~5.5.2: + version "5.5.2" + resolved "https://registry.yarnpkg.com/bootbox/-/bootbox-5.5.2.tgz#a4200aa03f12ffe4d07905834e9dfb76e52cee00" + integrity sha512-q8d9VO2A4+q6S0XvovLtqtBUp7uRy0wtDOuuycnoheK2TiAm3um0jOlAOu9ORn9XoT92tdil+p15Dle1mRgSPQ== dependencies: - bootstrap ">=3.0.0" - jquery ">=1.12.0" - popper.js ">=1.12.9" + bootstrap "^4.4.0" + jquery "^3.5.1" + popper.js "^1.16.0" bootstrap-select@1.13.18: version "1.13.18" @@ -3017,11 +3017,16 @@ bootstrap-slider@^9.8.1: resolved "https://registry.yarnpkg.com/bootstrap-slider/-/bootstrap-slider-9.10.0.tgz#1103d6bc00cfbfa8cfc9a2599ab518c55643da3f" integrity sha1-EQPWvADPv6jPyaJZmrUYxVZD2j8= -bootstrap@4.3.1, bootstrap@>=3.0.0: +bootstrap@4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.3.1.tgz#280ca8f610504d99d7b6b4bfc4b68cec601704ac" integrity sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag== +bootstrap@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.0.tgz#97b9f29ac98f98dfa43bf7468262d84392552fd7" + integrity sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw== + bops@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/bops/-/bops-0.0.6.tgz#082d1d55fa01e60dbdc2ebc2dba37f659554cf3a" @@ -6357,11 +6362,16 @@ jquery@3.5.1: resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5" integrity sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg== -jquery@>=1.12.0, jquery@>=1.7, jquery@>=1.9.1: +jquery@>=1.7, jquery@>=1.9.1: version "3.5.0" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.0.tgz#9980b97d9e4194611c36530e7dc46a58d7340fc9" integrity sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ== +jquery@^3.5.1: + version "3.6.0" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" + integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== + js-base64@^2.1.9: version "2.5.1" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" @@ -7922,10 +7932,10 @@ polygon-clipping@^0.15.2: dependencies: splaytree "^3.1.0" -popper.js@>=1.12.9: - version "1.16.0" - resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.0.tgz#2e1816bcbbaa518ea6c2e15a466f4cb9c6e2fbb3" - integrity sha512-+G+EkOPoE5S/zChTpmBSSDYmhXJ5PsW8eMhH8cP/CQHMFPBG/kC9Y5IIw6qNYgdJ+/COf0ddY2li28iHaZRSjw== +popper.js@^1.16.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" + integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== portscanner@2.1.1: version "2.1.1"