discourse/app/assets/javascripts
Andrei Prigorshnev cf1e8b2764
FEATURE: Accept the flag modal on CTRL + ENTER and CMD + ENTER (#13497)
We want to submit the flag modal on pressing CTRL + ENTER and CMD + ENTER.

Here's how our modals work:

Every modal can be dismissed by pressing ESC. This behaviour can be disabled for a specific modal if we need to.
Every modal can be submitted by pressing ENTER if the cursor wasn't on a text area or a form at the moment of pressing.
Now, the flag modal is actually a one big form and pressing ENTER doesn't submit it. I've added submitting by CTRL+ENTER but at first it was interfering with the basic modal submitting by ENTER. It's a pretty tricky thing to fix because we use the keyup event for submitting by ENTER and we need to use the keydown event for submitting with modifiers (because submitting by CMD+ENTER on Macs doesn't work with keyup).

Eventually, I fixed the problem just by adding a possibility to disable default submitting on ENTER (in the same way as we already have the possibility of disabling dismissing on ESC). Then I disabled default submitting for the flag form and implemented submitting by CTRL+ENTER and CMD+ENTER. This way everything is simple and robust. I did it only for the flag modal but it'll be easy and safe to add the same behaviour to another modal.
2021-06-24 14:13:38 +04:00
..
admin FIX: Table header translations on admin users list (#13505) 2021-06-23 13:19:30 -05:00
confirm-new-email
discourse FEATURE: Accept the flag modal on CTRL + ENTER and CMD + ENTER (#13497) 2021-06-24 14:13:38 +04:00
discourse-common FIX: Some absolute links were causing full page reloads (#13377) 2021-06-15 12:30:36 +10:00
discourse-hbr DEV: Update ember-cli across all in-repo addons (#13048) 2021-05-12 21:49:55 +02:00
discourse-widget-hbs DEV: Update ember-cli across all in-repo addons (#13048) 2021-05-12 21:49:55 +02:00
docs
ember-addons
locales DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
pretty-text FIX: Add word boundaries to replace and tag watched words (#13405) 2021-06-18 18:54:06 +03:00
select-kit UX: more consistent setting/edit buttons (#13276) 2021-06-03 18:33:36 -04:00
truth-helpers DEV: Update ember-cli across all in-repo addons (#13048) 2021-05-12 21:49:55 +02:00
wizard FIX: Wizard locale change wasn't applying to some elements (#12915) 2021-04-30 12:14:16 -04:00
activate-account.js
admin.js.erb
app-boot.js
application.js FEATURE: Improve group email settings UI (#13083) 2021-05-28 09:28:18 +10:00
auto-redirect.js
browser-detect.js
browser-update.js FIX: browser-update should work with old browsers (#12436) 2021-03-18 19:09:01 +02:00
discourse-loader.js
discourse-shims.js FIX: Update non-Ember CLI ember-buffered-proxy (#13227) 2021-06-01 16:49:03 +02:00
embed-application.js
ember_include.js.erb
ember_jquery.js
env.js
google-tag-manager.js FEATURE: Implement nonces for Google Tag Manager integration (#12531) 2021-03-26 11:19:31 -04:00
google-universal-analytics-v3.js
google-universal-analytics-v4.js
handlebars-shim.js
main_include_admin.js
markdown-it-bundle.js
onpopstate-handler.js
package.json FIX: Make truth-helpers work in Ember CLI (#13044) 2021-05-12 17:52:36 +02:00
polyfills.js
pretty-text-bundle.js
print-page.js
service-worker.js.erb DEV: debug: false for service workers to stop log spam via workbox (#12093) 2021-02-16 14:01:19 +10:00
set-prototype-polyfill.js
start-discourse.js
template_include.js
test-shims.js
vendor.js FEATURE: Optimize images before upload (#13432) 2021-06-23 12:31:12 -03:00
widget-runtime.js
wizard-application.js DEV: implements some of ember-truth-helpers (#12667) 2021-04-12 11:40:00 +02:00
wizard-shims.js
wizard-start.js
wizard-vendor.js DEV: Remove ember_jquery in most situations (#13237) 2021-06-01 15:32:51 -04:00
yarn.lock DEV: Add peer dependencies (#13132) 2021-05-25 18:39:40 +02:00