mirror of
https://github.com/wekan/wekan.git
synced 2026-02-06 16:41:48 +01:00
When RICHER_CARD_COMMENT_EDITOR=true, use richer editor
also when editing card description. Thanks to xet7 !
This commit is contained in:
parent
ec33cdcb29
commit
4e2d337620
6 changed files with 105 additions and 6 deletions
33
client/components/cards/cardDescription.js
Normal file
33
client/components/cards/cardDescription.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
const descriptionFormIsOpen = new ReactiveVar(false);
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onDestroyed() {
|
||||
descriptionFormIsOpen.set(false);
|
||||
},
|
||||
|
||||
descriptionFormIsOpen() {
|
||||
return descriptionFormIsOpen.get();
|
||||
},
|
||||
|
||||
getInput() {
|
||||
return this.$('.js-new-description-input');
|
||||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'submit .js-card-description'(event) {
|
||||
event.preventDefault();
|
||||
const description = this.currentComponent().getValue();
|
||||
this.data().setDescription(description);
|
||||
},
|
||||
// Pressing Ctrl+Enter should submit the form
|
||||
'keydown form textarea'(evt) {
|
||||
if (evt.keyCode === 13 && (evt.metaKey || evt.ctrlKey)) {
|
||||
this.find('button[type=submit]').click();
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
}).register('descriptionForm');
|
||||
Loading…
Add table
Add a link
Reference in a new issue