mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 17:30:13 +01:00
New Checklistitems are now autoresized too
- also using for autoresize now: verron:autosize
This commit is contained in:
parent
07aa1fd276
commit
03bfd9a2b5
1 changed files with 8 additions and 8 deletions
|
|
@ -186,12 +186,6 @@ BlazeComponent.extendComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// resize the textarea vertically to fit the user-input
|
|
||||||
autoResize(event) {
|
|
||||||
const textarea = event.target;
|
|
||||||
textarea.style.height = textarea.scrollHeight + 'px';
|
|
||||||
},
|
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
const events = {
|
const events = {
|
||||||
'click .toggle-delete-checklist-dialog'(event) {
|
'click .toggle-delete-checklist-dialog'(event) {
|
||||||
|
|
@ -215,8 +209,6 @@ BlazeComponent.extendComponent({
|
||||||
'click .js-delete-checklist-item': this.deleteItem,
|
'click .js-delete-checklist-item': this.deleteItem,
|
||||||
'click .confirm-checklist-delete': this.deleteChecklist,
|
'click .confirm-checklist-delete': this.deleteChecklist,
|
||||||
'focus .js-add-checklist-item': this.focusChecklistItem,
|
'focus .js-add-checklist-item': this.focusChecklistItem,
|
||||||
'input textarea.js-edit-checklist-item': this.autoResize,
|
|
||||||
'focus textarea.js-edit-checklist-item': this.autoResize,
|
|
||||||
keydown: this.pressKey,
|
keydown: this.pressKey,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
@ -231,6 +223,14 @@ Template.checklists.helpers({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.addChecklistItemForm.onRendered(() => {
|
||||||
|
autosize($('textarea.js-add-checklist-item'))
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.editChecklistItemForm.onRendered(() => {
|
||||||
|
autosize($('textarea.js-edit-checklist-item'))
|
||||||
|
});
|
||||||
|
|
||||||
Template.checklistDeleteDialog.onCreated(() => {
|
Template.checklistDeleteDialog.onCreated(() => {
|
||||||
const $cardDetails = this.$('.card-details');
|
const $cardDetails = this.$('.card-details');
|
||||||
this.scrollState = {
|
this.scrollState = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue