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 86690155b3
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-06 09:36:56 -08: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-06 09:36:56 -08:00
controllers DEV: Use aliased inject imports (#9086) 2020-03-06 11:41:41 -05:00
helpers FIX: Add aria-labels to topic list items (#9048) 2020-03-02 14:28:54 -05:00
initializers FEATURE: Enable service worker on iOS PWA 2020-03-02 15:55:09 -03:00
lib DEV: fix formatting 2020-03-05 12:59:16 -08:00
mixins DEV: Fix function prototype deprecations (#8681) 2020-01-16 18:56:53 +01:00
models FEATURE: New route for loading multiple user cards simultaneously (#9078) 2020-03-06 12:23:22 +00: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-06 09:36:56 -08:00
services DEV: Fix function prototype deprecations (#8681) 2020-01-16 18:56:53 +01:00
templates DEV: enforces link-rel-noopener linting rule (#8936) 2020-03-06 11:35:18 -05:00
widgets DEV: Remove the last (defunct) use of Ember.View (#8976) 2020-03-02 14:23:46 -05:00
mapping-router.js.es6 DEV: Remove Discourse.Site in favor of import (#8344) 2019-11-13 12:13:47 -05:00