discourse/app
Jeff Wong 111fa7e277 FEATURE: prevent accidental canceling when drafting penalties (#9129)
Pop up a confirmation box when there is input. This prevents accidental closing
of the dialog boxes due to clicking outside.

This adds a development hook on modals in the form of a `beforeClose`
function. Modal windows can abort the close if the funtion returns false.

Additionally fixing a few issues with loop and state on the modal popups:

Escape key with bootbox is keyup.
Updating modal to close on keyup as well so escape key is working.
Fixes an issue where pressing esc will loop immediately back to the modal by:
keydown -> bootbox -> keyup -> acts as "cancel", restores modal

Needs a next call to reopenModal otherwise, keyup is handled again by the modal.
Fixes an issue where pressing esc will loop immediately back to the confirm:
esc keyup will be handled and bubble immediately back to the modal.

Additionally, only handle key events when the #discourse-modal is visible.
This resolves issues where escape or enter events were being handled by
a hidden modal window.
2020-03-23 16:01:39 -07:00
..
assets FEATURE: prevent accidental canceling when drafting penalties (#9129) 2020-03-23 16:01:39 -07:00
controllers SECURITY: Respect topic permissions when loading draft metadata 2020-03-23 11:54:36 +00:00
helpers FIX: blank popular posts in summary emails due to lightbox images 2020-02-21 16:18:38 -05:00
jobs FEATURE: limit number of notifications per user to 10,000 2020-02-24 11:42:50 +11:00
mailers FIX: Replace deprecated URI.encode, URI.escape, URI.unescape and URI.unencode (#8528) 2019-12-12 12:49:21 +10:00
models SECURITY: Respect topic permissions when loading draft metadata 2020-03-23 11:54:36 +00:00
serializers SECURITY: Respect topic permissions when loading draft metadata 2020-03-23 11:54:36 +00:00
services FIX: ensures destroying a user with security keys doesn't fail (#9042) 2020-02-25 14:07:57 -05:00
views DEV: Load plugin stylesheets before theme stylesheets (#9240) 2020-03-19 19:24:06 +00:00