confirm fix

This commit is contained in:
yuri
2019-09-27 11:37:40 +03:00
parent a80f1f4662
commit 8e80153a1a
2 changed files with 12 additions and 8 deletions
+2 -2
View File
@@ -366,7 +366,7 @@ define('ui', [], function () {
dialog.close();
},
style: confirmStyle,
pullLeft: true
pullLeft: true,
},
{
text: cancelText,
@@ -381,7 +381,7 @@ define('ui', [], function () {
}
}
},
pullRight: true
pullRight: true,
}
]
});
+10 -6
View File
@@ -234,20 +234,24 @@ define('view', [], function () {
},
confirm: function (o, callback, context) {
var confirmStyle = null;
if (typeof o === 'string' || o instanceof String) {
var message = o;
var confirmText = this.translate('Yes');
o = o || {};
} else {
o = o || {};
var message = o.message;
var confirmText = o.confirmText;
confirmStyle = o.confirmStyle || null;
}
var confirmText = o.confirmText || this.translate('Yes');
var confirmStyle = o.confirmStyle || null;
var cancelText = o.cancelText || this.translate('Cancel');
return Espo.Ui.confirm(message, {
confirmText: confirmText,
cancelText: this.translate('Cancel'),
confirmStyle: confirmStyle
cancelText: cancelText,
confirmStyle: confirmStyle,
noCancelButton: o.noCancelButton,
backdrop: ('backdrop' in o) ? o.backdrop : false,
}, callback, context);
}
});