discourse/test/javascripts
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
..
acceptance FEATURE: prevent accidental canceling when drafting penalties (#9129) 2020-03-23 16:01:39 -07:00
admin DEV: Fix function prototype deprecations (#8681) 2020-01-16 18:56:53 +01:00
components FIX: ensures pinned-options header is showing correct state (#9156) 2020-03-12 07:41:17 +01:00
controllers DEV: Ember linting - disallow Ember.* variable usage (#8782) 2020-02-05 10:14:42 -06:00
ember DEV: introduces prettier for es6 files 2018-06-15 17:03:24 +02:00
fixtures FIX: correctly shows suggested topics label (#9017) 2020-02-21 12:35:49 +01:00
helpers DEV: Update the site title in qunit fixtures (#8959) 2020-02-14 11:30:04 +00:00
initializers FEATURE: Load translation overrides without JS eval 2019-11-05 19:16:38 +01:00
lib FIX: Stop infinite lookup-urls issue for video/audio on page (#9096) 2020-03-05 11:47:14 -05:00
mixins FIX: makes setting-object capable of defining value/name properties itself (#9003) 2020-02-19 10:01:21 +01:00
models FIX: Make category slug validation less strict (#8915) 2020-02-11 17:01:12 +02:00
utils DEV: adds afterRender decorator (#8864) 2020-02-10 08:13:13 +01:00
widgets DEV: Ember linting - disallow Ember.* variable usage (#8782) 2020-02-05 10:14:42 -06:00
plugin_tests.js.erb Support for Acceptance tests in plugins 2015-08-27 17:07:11 -04:00
test_helper.js DEV: Remove unused BreakString class (#8942) 2020-02-14 15:32:59 -03:00