discourse/test
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
..
javascripts FEATURE: prevent accidental canceling when drafting penalties (#9129) 2020-03-23 16:01:39 -07:00
stylesheets Manage qunit via yarn. 2018-09-11 15:07:28 +08:00
run-qunit.js DEV: Correct error message check in run-qunit 2019-12-12 14:06:06 +00:00
smoke_test.js DEV: Use classes for styling user and group cards (#8913) 2020-02-13 09:58:17 +00:00