Minicard sort popup, Enter button saves the new sort number

This commit is contained in:
Martin Filser 2021-10-12 14:55:59 +02:00
parent 02896e669a
commit b1b2d87045
2 changed files with 8 additions and 2 deletions

View file

@ -145,7 +145,7 @@ template(name="minicard")
if currentBoard.allowsCardSortingByNumber
.badge
span.badge-icon.fa.fa-sort
span.badge-text {{ sort }}
span.badge-text.check-list-sort {{ sort }}
template(name="editCardSortOrderPopup")
input.js-edit-card-sort-popup(type='text' autofocus value=sort dir="auto")

View file

@ -68,7 +68,7 @@ BlazeComponent.extendComponent({
},
},
{
'click span.badge-icon.fa.fa-sort, click span.badge-text' : Popup.open("editCardSortOrder"),
'click span.badge-icon.fa.fa-sort, click span.badge-text.check-list-sort' : Popup.open("editCardSortOrder"),
}
];
},
@ -101,6 +101,12 @@ BlazeComponent.extendComponent({
events() {
return [
{
'keydown input.js-edit-card-sort-popup'(evt) {
// enter = save
if (evt.keyCode === 13) {
this.find('button[type=submit]').click();
}
},
'click button.js-submit-edit-card-sort-popup'(event) {
// save button pressed
event.preventDefault();