Monitor pushState/popState for dismissing dialog(s).
This commit is contained in:
parent
acfd8cdd29
commit
ae202e9ce6
1 changed files with 9 additions and 0 deletions
|
|
@ -80,6 +80,10 @@ class RenderScripture {
|
||||||
constructor(dialog) {
|
constructor(dialog) {
|
||||||
this.dialog = dialog;
|
this.dialog = dialog;
|
||||||
|
|
||||||
|
window.addEventListener('popstate', (evt) => {
|
||||||
|
this.closeDialog();
|
||||||
|
});
|
||||||
|
|
||||||
if (hasLocalStorage()) {
|
if (hasLocalStorage()) {
|
||||||
this.ls = true;
|
this.ls = true;
|
||||||
this.translation = localStorage.getItem('__translation') || 'BSB';
|
this.translation = localStorage.getItem('__translation') || 'BSB';
|
||||||
|
|
@ -122,6 +126,11 @@ class RenderScripture {
|
||||||
.classList.remove('hidden');
|
.classList.remove('hidden');
|
||||||
this.buildTranslationList(this.sel);
|
this.buildTranslationList(this.sel);
|
||||||
this.readScripture(refs);
|
this.readScripture(refs);
|
||||||
|
history.pushState({
|
||||||
|
dialog: true,
|
||||||
|
scripture: scripture.value,
|
||||||
|
tx: this.translation
|
||||||
|
}, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTranslationList(sel) {
|
buildTranslationList(sel) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue