mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 21:17:18 -04:00
CardDetails sorting, only float number input possible (only working in an extra handler)
- defining in events() doesn't handle the return value and is ignored, maybe a bug in Blaze / Meteor.?
This commit is contained in:
parent
39069b322d
commit
57d35a294d
1 changed files with 12 additions and 7 deletions
|
@ -371,13 +371,6 @@ BlazeComponent.extendComponent({
|
|||
card.move(card.boardId, card.swimlaneId, card.listId, sort);
|
||||
}
|
||||
},
|
||||
'keypress/paste input.js-edit-card-sort'() {
|
||||
let keyCode = event.keyCode;
|
||||
let charCode = String.fromCharCode(keyCode);
|
||||
let regex = new RegExp('[0-9.]');
|
||||
let ret = regex.test(charCode);
|
||||
return ret;
|
||||
},
|
||||
'click .js-go-to-linked-card'() {
|
||||
Utils.goCardId(this.data().linkedId);
|
||||
},
|
||||
|
@ -506,6 +499,18 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('cardDetails');
|
||||
|
||||
// only allow number input
|
||||
Template.editCardSortOrderForm.onRendered(function() {
|
||||
this.$('input').on("keypress paste", function() {
|
||||
let keyCode = event.keyCode;
|
||||
let charCode = String.fromCharCode(keyCode);
|
||||
let regex = new RegExp('[-0-9.]');
|
||||
let ret = regex.test(charCode);
|
||||
// only working here, defining in events() doesn't handle the return value correctly
|
||||
return ret;
|
||||
});
|
||||
});
|
||||
|
||||
// We extends the normal InlinedForm component to support UnsavedEdits draft
|
||||
// feature.
|
||||
(class extends InlinedForm {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue