diff --git a/src/Application/views/admin/tpl/d3totplogin.tpl b/src/Application/views/admin/tpl/d3totplogin.tpl index d2b1768..6dd26e1 100644 --- a/src/Application/views/admin/tpl/d3totplogin.tpl +++ b/src/Application/views/admin/tpl/d3totplogin.tpl @@ -34,24 +34,27 @@
- + - + - + - + - + - +
[{capture name="d3js"}] - function clickEvent(next){ - const digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - if(digits.includes(event.key)){ + function clickEvent(previous, next){ + const digitKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + const deleteKeys = ['Backspace', 'Delete']; + if(next && digitKeys.includes(event.key)){ document.getElementById(next).focus(); + } else if(previous && deleteKeys.includes(event.key)){ + document.getElementById(previous).focus(); } } document.addEventListener("paste", function(e) { @@ -71,7 +74,7 @@
[{oxstyle include=$oViewConf->getModuleUrl('d3totp', 'out/admin/src/css/d3totplogin.css')}] diff --git a/src/Application/views/tpl/d3totplogin.tpl b/src/Application/views/tpl/d3totplogin.tpl index 816687b..c6ec44d 100644 --- a/src/Application/views/tpl/d3totplogin.tpl +++ b/src/Application/views/tpl/d3totplogin.tpl @@ -25,24 +25,27 @@
- + - + - + - + - + - +
[{capture name="d3js"}] - function clickEvent(next){ - const digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - if(digits.includes(event.key)){ + function clickEvent(previous, next){ + const digitKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + const deleteKeys = ['Backspace', 'Delete']; + if(next && digitKeys.includes(event.key)){ document.getElementById(next).focus(); + } else if(previous && deleteKeys.includes(event.key)){ + document.getElementById(previous).focus(); } } document.addEventListener("paste", function(e) {