Skip to content

Commit

Permalink
Merge pull request #306 from Mesuva/add-cancel-warning-inline-edit
Browse files Browse the repository at this point in the history
Add check prompt when content block cancel used
  • Loading branch information
aembler authored Oct 13, 2023
2 parents 3b2e70a + 0436916 commit d51e469
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions assets/ckeditor/js/concrete/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ CKEDITOR.plugins.add('concreteinline', {

editor.addCommand('c5cancel', {
exec: function (editor) {
ConcreteEvent.fire('EditModeExitInline')
editor.destroy()
if (editor.checkDirty()) {
ConcreteAlert.confirm(ccmi18n_editor.cancelPrompt, function () {
$.fn.dialog.closeTop();
ConcreteEvent.fire('EditModeExitInline')
editor.destroy()
}, 'btn-danger', ccmi18n_editor.cancelPromptButton);
} else {
ConcreteEvent.fire('EditModeExitInline')
editor.destroy()
}
}
})

Expand Down

0 comments on commit d51e469

Please sign in to comment.