mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-02-12 16:12:44 +00:00
add ctrl+s to save modal on Editor modals
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -15,8 +15,12 @@
|
||||
|
||||
function handleKeydown(event) {
|
||||
if (event.ctrlKey && event.key === 's') {
|
||||
// only trigger if the form or its descendants have focus and we're in update mode
|
||||
if (modalMode === 'update' && formElement && formElement.contains(document.activeElement)) {
|
||||
// trigger if the form or its descendants have focus and we're in create, update, or copy mode
|
||||
if (
|
||||
(modalMode === 'create' || modalMode === 'update' || modalMode === 'copy') &&
|
||||
formElement &&
|
||||
formElement.contains(document.activeElement)
|
||||
) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
|
||||
Reference in New Issue
Block a user