FIX: Stop saving bookmark on modal press ESC (PR #14823)

Since db7be947df29bb2ab27dd3abd80e3b470dcb74e5 the functionality to not save a bookmark when pressing ESC on the modal has been broken, because a new initiatedByESC event was introduced there in d-modal instead of clicking on the modal close button. This commit fixes the issue by adding an initiatedByESC property to onClose inside application.js, and checking for that OR initiatedByCloseButton in the bookmark modal.

GitHub

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