Introduced confirm and confirmDelete functions in the Angular overlay service (#6526)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
5641a6cd35
commit
bfdbc4cb8b
@@ -65,10 +65,39 @@
|
||||
open(overlay);
|
||||
}
|
||||
|
||||
function confirm(overlay) {
|
||||
|
||||
if (!overlay.closeButtonLabelKey) overlay.closeButtonLabelKey = "general_cancel";
|
||||
if (!overlay.view) overlay.view = "views/common/overlays/confirm/confirm.html";
|
||||
if (!overlay.close) overlay.close = function () { close(); };
|
||||
|
||||
switch (overlay.confirmType) {
|
||||
|
||||
case "delete":
|
||||
if (!overlay.confirmMessageStyle) overlay.confirmMessageStyle = "danger";
|
||||
if (!overlay.submitButtonStyle) overlay.submitButtonStyle = "danger";
|
||||
if (!overlay.submitButtonLabelKey) overlay.submitButtonLabelKey = "contentTypeEditor_yesDelete";
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!overlay.submitButtonLabelKey) overlay.submitButtonLabelKey = "general_confirm";
|
||||
|
||||
}
|
||||
|
||||
open(overlay);
|
||||
|
||||
}
|
||||
|
||||
function confirmDelete(overlay) {
|
||||
confirm(overlay);
|
||||
}
|
||||
|
||||
var service = {
|
||||
open: open,
|
||||
close: close,
|
||||
ysod: ysod
|
||||
ysod: ysod,
|
||||
confirm: confirm,
|
||||
confirmDelete: confirmDelete
|
||||
};
|
||||
|
||||
return service;
|
||||
|
||||
Reference in New Issue
Block a user