Cleanup AbstractViewPopup handling

This commit is contained in:
the-djmaze 2023-02-12 00:27:11 +01:00
parent 163e926d6b
commit 98d686bc14
2 changed files with 4 additions and 13 deletions

View file

@ -78,9 +78,10 @@ export class AbstractViewPopup extends AbstractView
afterShow() {} // Happens after showModal() animation transitionend
onHide() {} // Happens before animation transitionend
afterHide() {} // Happens after animation transitionend
close() {}
*/
close() {
this.modalVisible(false);
}
}
AbstractViewPopup.showModal = function(params = []) {

View file

@ -48,8 +48,6 @@ const
vm.viewModelDom = ViewModelClass.__dom = vmDom;
if (dialog) {
vm.close = () => hideScreenPopup(ViewModelClass);
// Firefox < 98 / Safari < 15.4 HTMLDialogElement not defined
if (!vmDom.showModal) {
vmDom.className = 'polyfill';
@ -155,14 +153,6 @@ const
});
},
/**
* @param {Function} ViewModelClassToHide
* @returns {void}
*/
hideScreenPopup = ViewModelClassToHide =>
ViewModelClassToHide?.__vm && ViewModelClassToHide.__dom
&& ViewModelClassToHide.__vm.modalVisible(false),
/**
* @param {string} screenName
* @param {string} subPart
@ -276,7 +266,7 @@ export const
});
const cross = new Crossroads();
cross.addRoute(/^([^/]+)\/?(.*)$/, screenOnRoute);
cross.addRoute(/^([^/]*)\/?(.*)$/, screenOnRoute);
hasher.add(cross.parse.bind(cross));
hasher.init();