summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-06-26 01:42:02 +0300
committerLauri Ojansivu <x@xet7.org>2018-06-26 01:42:02 +0300
commitc372ea02f7b3667b8fe45fbd761ac23d3a1bbcc4 (patch)
treed7833a8dcba384949f2eb6a9a0c6f9ed200fcfce
parent03921a969a27925712ba0a7746e9dcf19028c968 (diff)
parentdaa95c582e9f11e15bb67389de5a97ded45dbc42 (diff)
downloadwekan-c372ea02f7b3667b8fe45fbd761ac23d3a1bbcc4.tar.gz
wekan-c372ea02f7b3667b8fe45fbd761ac23d3a1bbcc4.tar.bz2
wekan-c372ea02f7b3667b8fe45fbd761ac23d3a1bbcc4.zip
Merge branch 'pravdomil-patch-6' into devel
-rw-r--r--CHANGELOG.md4
-rw-r--r--client/lib/inlinedform.js12
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a801988c..e1fe261c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,9 @@ This release adds the following new features:
and fixes the following bugs:
* [Fix typo in English translation](https://github.com/wekan/wekan/pull/1710);
-* [Fix vertical align of user avatar initials](https://github.com/wekan/wekan/pull/1714).
+* [Fix vertical align of user avatar initials](https://github.com/wekan/wekan/pull/1714);
+* [Submit inline form on click outside]https://github.com/wekan/wekan/pull/1717), fixes
+ ["You have an unsaved description" doesn't go away after saving](https://github.com/wekan/wekan/issues/1287).
Thanks to GitHub users pravdomil, xet7 and zypA13510 for their contributions.
diff --git a/client/lib/inlinedform.js b/client/lib/inlinedform.js
index 56768a13..e5e4d4ed 100644
--- a/client/lib/inlinedform.js
+++ b/client/lib/inlinedform.js
@@ -75,6 +75,16 @@ InlinedForm = BlazeComponent.extendComponent({
EscapeActions.register('inlinedForm',
() => { currentlyOpenedForm.get().close(); },
() => { return currentlyOpenedForm.get() !== null; }, {
- noClickEscapeOn: '.js-inlined-form',
+ enabledOnClick: false,
}
);
+
+// submit on click outside
+document.addEventListener('click', function(evt) {
+ const openedForm = currentlyOpenedForm.get();
+ const isClickOutside = $(evt.target).closest('.js-inlined-form').length === 0;
+ if (openedForm && isClickOutside) {
+ $('.js-inlined-form button[type=submit]').click();
+ openedForm.close();
+ }
+}, true);