From 3546d7aa02bc65cf1183cb493adeb543ba51945d Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 31 Mar 2020 16:56:32 +0300 Subject: 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 --- client/components/activities/comments.js | 7 ------ client/components/main/editor.jade | 7 +----- client/components/main/editor.js | 38 ++++---------------------------- 3 files changed, 5 insertions(+), 47 deletions(-) (limited to 'client/components') 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) { -- cgit v1.2.3-1-g7c22