mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-26 15:04:36 +08:00
Cleanup AbstractViewPopup handling
This commit is contained in:
parent
163e926d6b
commit
98d686bc14
2 changed files with 4 additions and 13 deletions
|
@ -78,9 +78,10 @@ export class AbstractViewPopup extends AbstractView
|
||||||
afterShow() {} // Happens after showModal() animation transitionend
|
afterShow() {} // Happens after showModal() animation transitionend
|
||||||
onHide() {} // Happens before animation transitionend
|
onHide() {} // Happens before animation transitionend
|
||||||
afterHide() {} // Happens after animation transitionend
|
afterHide() {} // Happens after animation transitionend
|
||||||
|
|
||||||
close() {}
|
|
||||||
*/
|
*/
|
||||||
|
close() {
|
||||||
|
this.modalVisible(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractViewPopup.showModal = function(params = []) {
|
AbstractViewPopup.showModal = function(params = []) {
|
||||||
|
|
|
@ -48,8 +48,6 @@ const
|
||||||
vm.viewModelDom = ViewModelClass.__dom = vmDom;
|
vm.viewModelDom = ViewModelClass.__dom = vmDom;
|
||||||
|
|
||||||
if (dialog) {
|
if (dialog) {
|
||||||
vm.close = () => hideScreenPopup(ViewModelClass);
|
|
||||||
|
|
||||||
// Firefox < 98 / Safari < 15.4 HTMLDialogElement not defined
|
// Firefox < 98 / Safari < 15.4 HTMLDialogElement not defined
|
||||||
if (!vmDom.showModal) {
|
if (!vmDom.showModal) {
|
||||||
vmDom.className = 'polyfill';
|
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} screenName
|
||||||
* @param {string} subPart
|
* @param {string} subPart
|
||||||
|
@ -276,7 +266,7 @@ export const
|
||||||
});
|
});
|
||||||
|
|
||||||
const cross = new Crossroads();
|
const cross = new Crossroads();
|
||||||
cross.addRoute(/^([^/]+)\/?(.*)$/, screenOnRoute);
|
cross.addRoute(/^([^/]*)\/?(.*)$/, screenOnRoute);
|
||||||
|
|
||||||
hasher.add(cross.parse.bind(cross));
|
hasher.add(cross.parse.bind(cross));
|
||||||
hasher.init();
|
hasher.init();
|
||||||
|
|
Loading…
Add table
Reference in a new issue