mirror of
https://github.com/wekan/wekan.git
synced 2025-12-26 12:18:49 +01:00
Merge pull request #4060 from mfilser/popup_sorting_number
Popup sorting number
This commit is contained in:
commit
a30fee95bf
4 changed files with 44 additions and 2 deletions
|
|
@ -377,6 +377,12 @@ BlazeComponent.extendComponent({
|
|||
this.data().setRequestedBy('');
|
||||
}
|
||||
},
|
||||
'keydown input.js-edit-card-sort'(evt) {
|
||||
// enter = save
|
||||
if (evt.keyCode === 13) {
|
||||
this.find('button[type=submit]').click();
|
||||
}
|
||||
},
|
||||
'submit .js-card-details-sort'(event) {
|
||||
event.preventDefault();
|
||||
const sort = parseFloat(this.currentComponent()
|
||||
|
|
|
|||
|
|
@ -145,4 +145,9 @@ 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")
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-submit-edit-card-sort-popup(type="submit") {{_ 'save'}}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
'click span.badge-icon.fa.fa-sort, click span.badge-text.check-list-sort' : Popup.open("editCardSortOrder"),
|
||||
}
|
||||
];
|
||||
},
|
||||
}).register('minicard');
|
||||
|
|
@ -93,3 +96,30 @@ Template.minicard.helpers({
|
|||
}
|
||||
},
|
||||
});
|
||||
|
||||
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();
|
||||
const sort = this.$('.js-edit-card-sort-popup')[0]
|
||||
.value
|
||||
.trim();
|
||||
if (!Number.isNaN(sort)) {
|
||||
let card = this.data();
|
||||
card.move(card.boardId, card.swimlaneId, card.listId, sort);
|
||||
Popup.close();
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
}).register('editCardSortOrderPopup');
|
||||
|
|
|
|||
|
|
@ -1085,5 +1085,6 @@
|
|||
"history": "History",
|
||||
"request": "Request",
|
||||
"requests": "Requests",
|
||||
"help-request": "Help Request"
|
||||
"help-request": "Help Request",
|
||||
"editCardSortOrderPopup-title": "Change Sorting"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue