mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
34 lines
827 B
JavaScript
34 lines
827 B
JavaScript
|
|
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');
|