summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-03-31 16:56:32 +0300
committerLauri Ojansivu <x@xet7.org>2020-03-31 16:56:32 +0300
commit3546d7aa02bc65cf1183cb493adeb543ba51945d (patch)
treed386280609e58fb6670eb42fbd2d9a44c5b28504 /client/components
parent29d62440a5cf82b01de8183a384c6d7811abad81 (diff)
downloadwekan-3546d7aa02bc65cf1183cb493adeb543ba51945d.tar.gz
wekan-3546d7aa02bc65cf1183cb493adeb543ba51945d.tar.bz2
wekan-3546d7aa02bc65cf1183cb493adeb543ba51945d.zip
Fix Browser always reload the whole page when I change one of the card color.
Fixed by making label colors and text again editable. Regression from [Wekan v3.86 2)](https://github.com/wekan/wekan/commit/b9099a8b7ea6f63c79bdcbb871cb993b2cb7e325). Thanks to javen9881 and xet7 ! Closes #2971
Diffstat (limited to 'client/components')
-rw-r--r--client/components/activities/comments.js7
-rw-r--r--client/components/main/editor.jade7
-rwxr-xr-xclient/components/main/editor.js38
3 files changed, 5 insertions, 47 deletions
diff --git a/client/components/activities/comments.js b/client/components/activities/comments.js
index e885459e..50ca019b 100644
--- a/client/components/activities/comments.js
+++ b/client/components/activities/comments.js
@@ -33,13 +33,6 @@ BlazeComponent.extendComponent({
cardId,
});
resetCommentInput(input);
- // With Richer editor is in use, and comment is submitted,
- // clear comment form with JQuery. Id #summernote is defined
- // at client/components/main/editor.jade where it previously was
- // id=id, now it is id="summernote".
- if (Meteor.settings.public.RICHER_CARD_COMMENT_EDITOR === 'true') {
- $('#summernote').summernote('code', '');
- }
Tracker.flush();
autosize.update(input);
input.trigger('submitted');
diff --git a/client/components/main/editor.jade b/client/components/main/editor.jade
index 5c5454ee..dbd61715 100644
--- a/client/components/main/editor.jade
+++ b/client/components/main/editor.jade
@@ -1,13 +1,8 @@
template(name="editor")
- // With Richer editor is in use, and comment is submitted,
- // clear comment form with JQuery Comment at
- // client/components/activities/comments.js . Id #summernote is defined
- // here at client/components/main/editor.jade where it previously was
- // id=id, now it is id="summernote".
textarea.editor(
dir="auto"
class="{{class}}"
- id="summernote"
+ id=id
autofocus=autofocus
placeholder="{{_ 'comment-placeholder'}}")
+Template.contentBlock
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index 3f09d284..86c0078f 100755
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -30,7 +30,7 @@ Template.editor.onRendered(() => {
autosize($textarea);
$textarea.escapeableTextComplete(mentions);
};
- if (Meteor.settings.public.RICHER_CARD_COMMENT_EDITOR === 'true') {
+ if (Meteor.settings.public.RICHER_CARD_COMMENT_EDITOR !== false) {
const isSmall = Utils.isMiniScreen();
const toolbar = isSmall
? [
@@ -108,37 +108,10 @@ Template.editor.onRendered(() => {
}
return undefined;
};
- // Prevent @member mentions on Add Comment input field
- // from closing card, part 1.
- let popupShown = false;
inputs.each(function(idx, input) {
mSummernotes[idx] = $(input).summernote({
placeholder,
- // Prevent @member mentions on Add Comment input field
- // from closing card, part 2.
- onKeydown(e) {
- if (popupShown) {
- e.preventDefault();
- }
- },
- onKeyup(e) {
- if (popupShown) {
- e.preventDefault();
- }
- },
callbacks: {
- // Prevent @member mentions on Add Comment input field
- // from closing card, part 3.
- onKeydown(e) {
- if (popupShown) {
- e.preventDefault();
- }
- },
- onKeyup(e) {
- if (popupShown) {
- e.preventDefault();
- }
- },
onInit(object) {
const originalInput = this;
$(originalInput).on('input', function() {
@@ -163,6 +136,7 @@ Template.editor.onRendered(() => {
});
}
},
+
onImageUpload(files) {
const $summernote = getSummernote(this);
if (files && files.length > 0) {
@@ -323,8 +297,7 @@ Blaze.Template.registerHelper(
}
const linkValue = [' ', at, knowedUser.username];
- //let linkClass = 'atMention js-open-member';
- let linkClass = 'atMention';
+ let linkClass = 'atMention js-open-member';
if (knowedUser.userId === Meteor.userId()) {
linkClass += ' me';
}
@@ -367,10 +340,7 @@ Template.viewer.events({
const userId = event.currentTarget.dataset.userid;
if (userId) {
- // Prevent @member mentions on Add Comment input field
- // from closing card, part 4.
- PopupNoClose.open('member').call({ userId }, event, templateInstance);
- event.preventDefault();
+ Popup.open('member').call({ userId }, event, templateInstance);
} else {
const href = event.currentTarget.href;
if (href) {