Kenneth Bruen
2 years ago
10 changed files with 152 additions and 9 deletions
@ -1,8 +1,15 @@ |
|||||||
window.addEventListener('load', function (e) { |
window.addEventListener('load', function (e) { |
||||||
this.document.body.addEventListener('keydown', function (e) { |
document.body.addEventListener('keydown', function (e) { |
||||||
if (e.key == 'Backspace' && (e.target.tagName.toUpperCase() !== 'INPUT' || e.target.value.length === 0)) { |
if (e.key == 'Backspace' && (e.target.tagName.toUpperCase() !== 'INPUT' || e.target.value.length === 0)) { |
||||||
e.preventDefault() |
e.preventDefault() |
||||||
window.history.back() |
window.history.back() |
||||||
} |
} |
||||||
}) |
}) |
||||||
|
|
||||||
|
var backButton = document.getElementById('back-button') |
||||||
|
if (backButton) { |
||||||
|
backButton.addEventListener('click', function (e) { |
||||||
|
window.history.back() |
||||||
|
}) |
||||||
|
} |
||||||
}) |
}) |
||||||
|
Loading…
Reference in new issue