FIX: Do not save bookmark if close (X) on modal is clicked (PR #9541)

  • After this change the bookmark will still be saved if clicking out of the modal or pressing escape
  • To achieve this I implemented an initiatedBy parameter for modal closing from d-modal. If clicking on the cross it is initiated by close, if clicking out of the modal it is by click out.
  • These options can then be compared in controllers consuming onClose

GitHub

sendAction should be avoided

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542/120

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542/121

          {{d-button icon="times" action=(route-action "closeModal" "initiatedByCloseButton") class="btn-flat modal-close close" title="modal.close"}}

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542/122