|
@@ -361,6 +361,16 @@ BlazeComponent.extendComponent({
|
|
this.data().setRequestedBy('');
|
|
this.data().setRequestedBy('');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ 'submit .js-card-details-sort'(event) {
|
|
|
|
+ event.preventDefault();
|
|
|
|
+ const sort = parseFloat(this.currentComponent()
|
|
|
|
+ .getValue()
|
|
|
|
+ .trim());
|
|
|
|
+ if (sort) {
|
|
|
|
+ let card = this.data();
|
|
|
|
+ card.move(card.boardId, card.swimlaneId, card.listId, sort);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
'click .js-go-to-linked-card'() {
|
|
'click .js-go-to-linked-card'() {
|
|
Utils.goCardId(this.data().linkedId);
|
|
Utils.goCardId(this.data().linkedId);
|
|
},
|
|
},
|
|
@@ -489,6 +499,18 @@ BlazeComponent.extendComponent({
|
|
},
|
|
},
|
|
}).register('cardDetails');
|
|
}).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
|
|
// We extends the normal InlinedForm component to support UnsavedEdits draft
|
|
// feature.
|
|
// feature.
|
|
(class extends InlinedForm {
|
|
(class extends InlinedForm {
|