This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse
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
..
adapters FIX: Use new tag routes (#8683) 2020-01-21 19:23:08 +02:00
components FEATURE: prevent accidental canceling when drafting penalties (#9129) 2020-03-23 16:01:39 -07:00
controllers DEV: Deprecate ember module imports (#9011) 2020-02-21 15:56:49 +01:00
helpers FIX: ensures topic count is correctly showing in box category badges (#9034) 2020-02-24 23:41:36 +01:00
initializers FEATURE: Use new Badging API 2020-01-10 13:41:35 -03:00
lib FIX: throttles topic tracking shortcut and enforces topic id (#9159) 2020-03-13 12:03:55 +01:00
mixins DEV: Fix function prototype deprecations (#8681) 2020-01-16 18:56:53 +01:00
models FIX: ensures we don't attempt to create a new PM on an existing topic (#9029) 2020-02-24 08:55:12 -06:00
pre-initializers FEATURE: Add Tactile feedback on likes 2020-01-30 12:01:52 -03:00
raw-views DEV: Fix function prototype deprecations (#8681) 2020-01-16 18:56:53 +01:00
routes FEATURE: prevent accidental canceling when drafting penalties (#9129) 2020-03-23 16:01:39 -07:00
services DEV: Fix function prototype deprecations (#8681) 2020-01-16 18:56:53 +01:00
templates Merge pull request from GHSA-vw39-6w7q-gfx5 2020-02-27 11:57:10 -06:00
widgets FIX: muted was not working in topic timeline (#9021) 2020-02-21 21:32:58 +01:00
mapping-router.js.es6 DEV: Remove Discourse.Site in favor of import (#8344) 2019-11-13 12:13:47 -05:00