From 71630aaa77b518d3d0165f772251f09cc249f015 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 16 Oct 2018 01:47:38 +0100 Subject: Easier closing of dialogs Allow closing of dialogs by clicking on the background area around it. When the dialog is closed in this manner, if it contains a form with changed data present a warning that there are unsaved changes. Likewise if the user attempts to navigate away from the page, eg page reload, bookmark click, address bar entry. If the dialog does not contain a form or the data remains unchanged no warning messages are shown. --- assets/js/components/keyboard-shortcuts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'assets/js/components/keyboard-shortcuts.js') diff --git a/assets/js/components/keyboard-shortcuts.js b/assets/js/components/keyboard-shortcuts.js index 02d62119..194beb7f 100644 --- a/assets/js/components/keyboard-shortcuts.js +++ b/assets/js/components/keyboard-shortcuts.js @@ -27,7 +27,7 @@ KB.keyboardShortcuts = function () { KB.onKey('?', function () { if (! KB.modal.isOpen()) { - KB.modal.open(KB.find('body').data('keyboardShortcutUrl')); + KB.modal.open(KB.find('body').data('keyboardShortcutUrl'), '', true); } }); @@ -62,7 +62,7 @@ KB.keyboardShortcuts = function () { KB.onKey('n', function () { if (! KB.modal.isOpen()) { - KB.modal.open(KB.find('#board').data('taskCreationUrl'), 'large', false); + KB.modal.open(KB.find('#board').data('taskCreationUrl'), 'large', true); } }); } @@ -70,25 +70,25 @@ KB.keyboardShortcuts = function () { if (KB.exists('#task-view')) { KB.onKey('e', function () { if (! KB.modal.isOpen()) { - KB.modal.open(KB.find('#task-view').data('editUrl'), 'large', false); + KB.modal.open(KB.find('#task-view').data('editUrl'), 'large', true); } }); KB.onKey('c', function () { if (! KB.modal.isOpen()) { - KB.modal.open(KB.find('#task-view').data('commentUrl'), 'medium', false); + KB.modal.open(KB.find('#task-view').data('commentUrl'), 'medium', true); } }); KB.onKey('s', function () { if (! KB.modal.isOpen()) { - KB.modal.open(KB.find('#task-view').data('subtaskUrl'), 'medium', false); + KB.modal.open(KB.find('#task-view').data('subtaskUrl'), 'medium', true); } }); KB.onKey('l', function () { if (! KB.modal.isOpen()) { - KB.modal.open(KB.find('#task-view').data('internalLinkUrl'), 'medium', false); + KB.modal.open(KB.find('#task-view').data('internalLinkUrl'), 'medium', true); } }); } -- cgit v1.2.3