Skip to content

Commit

Permalink
improve dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Aug 17, 2024
1 parent ad529e6 commit 5f4117e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resource/js/model/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,19 @@
if (message['btns'] !== undefined) {
btns = message['btns'];
}
if (message['cancel_text']) {
btns[0].text = message['cancel_text'];
}
if (message['confirm_text']) {
btns[1].text = message['confirm_text'];
}
if (message['content'] === undefined) {
throw 'message.content can not be empty.';
}
if (message['onshown'] !== undefined) {
onshown = message['onshown'];
}

message = message['content'];
}

Expand Down Expand Up @@ -411,6 +418,7 @@
header: title ? true : false,
size: size,
backdrop: 'static',
btns: btns,
onshown: onshown,
onsure: function () {
if (confirm && typeof confirm === 'function') {
Expand Down

0 comments on commit 5f4117e

Please sign in to comment.