diff --git a/src/utils/modal.js b/src/utils/modal.js index d0bc9db..435153a 100644 --- a/src/utils/modal.js +++ b/src/utils/modal.js @@ -80,6 +80,10 @@ class RenderScripture { constructor(dialog) { this.dialog = dialog; + window.addEventListener('popstate', (evt) => { + this.closeDialog(); + }); + if (hasLocalStorage()) { this.ls = true; this.translation = localStorage.getItem('__translation') || 'BSB'; @@ -122,6 +126,11 @@ class RenderScripture { .classList.remove('hidden'); this.buildTranslationList(this.sel); this.readScripture(refs); + history.pushState({ + dialog: true, + scripture: scripture.value, + tx: this.translation + }, ''); } buildTranslationList(sel) {