wekan/client/components/cards/cardDescription.js
Lauri Ojansivu 6ff9c5b58d Added German (Switzerland) (de_CH) Part 3.
Fixed lint.

Thanks to translators and xet7 !
2021-04-16 21:47:39 +03:00

34 lines
858 B
JavaScript

const descriptionFormIsOpen = new ReactiveVar(false);
BlazeComponent.extendComponent({
onDestroyed() {
descriptionFormIsOpen.set(false);
$('.note-popover').hide();
},
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');