mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Fixing the Enter submission on the List item entry view
This commit is contained in:
parent
fe8f56654b
commit
051d2eeabc
2 changed files with 17 additions and 7 deletions
|
|
@ -51,12 +51,23 @@ Template.listItemsForm.events({
|
|||
});
|
||||
}
|
||||
},
|
||||
'keypress #listItemInput' (event) {
|
||||
event.preventDefault();
|
||||
|
||||
},
|
||||
'click .editListItem' (event) {
|
||||
event.preventDefault();
|
||||
'keydown #listItems' (event) {
|
||||
if (event.which === 13) {
|
||||
let item = $("#listItems").val();
|
||||
let listId = Session.get("listId");
|
||||
if (item == null || item == "") {
|
||||
Session.set("itemReqErr", true);
|
||||
} else {
|
||||
Meteor.call("add.listItem", item, listId, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR adding item to list: " + err);
|
||||
} else {
|
||||
console.log(" SUCCESS adding item to list.");
|
||||
$("#listItems").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
'click #showReceivedItems' (event) {
|
||||
if ($("#showReceivedItems").prop('checked') == true) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue