|
@@ -1,7 +1,7 @@
|
|
|
const {dialog} = require('electron');
|
|
|
-const obj = {};
|
|
|
+const dlg = {};
|
|
|
|
|
|
-obj.messagePromise = function(title, content, type = '', buttons = ['Ok'], defaultButton = 0, attach = true) {
|
|
|
+dlg.messagePromise = function(title, content, type = '', buttons = ['Ok'], defaultButton = 0, attach = true) {
|
|
|
const opts = {
|
|
|
type: type,
|
|
|
title: title,
|
|
@@ -16,8 +16,8 @@ obj.messagePromise = function(title, content, type = '', buttons = ['Ok'], defau
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-obj.message = function(title, content, type = 'info', buttons = ['Ok'], defaultButton = 0, attach = true, callback = null) {
|
|
|
- const promise = obj.messagePromise(title, content, type, buttons, defaultButton, attach);
|
|
|
+dlg.message = function(title, content, type = 'info', buttons = ['Ok'], defaultButton = 0, attach = true, callback = null) {
|
|
|
+ const promise = dlg.messagePromise(title, content, type, buttons, defaultButton, attach);
|
|
|
if (callback !== null) {
|
|
|
promise.then(data => {
|
|
|
callback(data.response, buttons[data.response]);
|
|
@@ -25,4 +25,4 @@ obj.message = function(title, content, type = 'info', buttons = ['Ok'], defaultB
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-module.exports = obj;
|
|
|
+module.exports = dlg;
|