VulpesOS/assets/webapps/system.gaiamobile.org/js/custom_dialog_service.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

33 lines
1 KiB
JavaScript

/* global BaseModule, CustomDialog, LazyLoader */
'use strict';
(function() {
/**
* The module is grouping custom dialog request.
* It will lazy load CustomDialog once the first request comes.
* XXX: All custom dialogs in system app
* should be transfered into systemDialog in the future.
*/
var CustomDialogService = function() {};
CustomDialogService.SERVICES = [
'showCustomDialog',
'hideCustomDialog'
];
BaseModule.create(CustomDialogService, {
name: 'CustomDialogService',
showCustomDialog: function(title, msg, cancel, confirm) {
return LazyLoader.load(['shared/js/custom_dialog.js']).then(() => {
CustomDialog.show(title, msg, cancel, confirm,
document.getElementById('screen'))
.setAttribute('data-z-index-level', 'system-dialog');
}).catch((err) => {
console.error(err);
});
},
hideCustomDialog: function() {
if (window.CustomDialog) {
CustomDialog && CustomDialog.hide();
}
}
});
}());