mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Many chcanges, but version 0.1.0 is ready to be cut.
This commit is contained in:
parent
42643a37f5
commit
6e37ae8c74
46 changed files with 1038 additions and 273 deletions
57
client/Lists/listsTbl.js
Normal file
57
client/Lists/listsTbl.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import { Lists } from '../../imports/api/lists.js';
|
||||
|
||||
Template.listsTbl.onCreated(function() {
|
||||
this.subscribe("myLists");
|
||||
});
|
||||
|
||||
Template.listsTbl.onRendered(function() {
|
||||
$('.modal').modal();
|
||||
});
|
||||
|
||||
Template.listsTbl.helpers({
|
||||
mylists: function() {
|
||||
return Lists.find({});
|
||||
},
|
||||
});
|
||||
|
||||
Template.listsTbl.events({
|
||||
'click li.collection-item' (event) {
|
||||
event.preventDefault();
|
||||
let sender = event.target;
|
||||
// console.log("Sender origination from: ");
|
||||
// console.log(sender.localName);
|
||||
if (sender.localName == "li") {
|
||||
let listId = event.currentTarget.id;
|
||||
if (listId == "addList") {
|
||||
$('#modalList').modal('open');
|
||||
} else {
|
||||
console.log("listId is: " + listId);
|
||||
Session.set("listId", listId);
|
||||
Meteor.setTimeout(function() {
|
||||
FlowRouter.go('/listitems');
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
'click i.markAsComplete' (event) {
|
||||
event.preventDefault();
|
||||
let sender = event.target;
|
||||
// console.log("Sender origination from: " );
|
||||
// console.log(sender.localName);
|
||||
if (sender.localName == "i") {
|
||||
let listFullId = event.currentTarget.id;
|
||||
let splitList = listFullId.split("_");
|
||||
let listId = splitList[1];
|
||||
// console.log("listId is " + listId);
|
||||
Meteor.call("mark.complete", listId, function(err, result){
|
||||
if (err) {
|
||||
console.log(" ERROR marking list complete! " + err);
|
||||
showSnackbar("ERROR! List Not Makred Complete!", "red");
|
||||
} else {
|
||||
console.log(" SUCCESS marking list complete.");
|
||||
showSnackbar("List Marked Complete!", "green");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue