Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
33 lines
1 KiB
JavaScript
Executable file
33 lines
1 KiB
JavaScript
Executable file
/* 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();
|
|
}
|
|
}
|
|
});
|
|
}());
|