mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updating framework to meteor 3 and later
This commit is contained in:
parent
717994508a
commit
cca29bc591
58 changed files with 2332 additions and 1611 deletions
|
|
@ -29,15 +29,7 @@ Template.listMgmtForm.events({
|
|||
Session.set("listNameMiss", true);
|
||||
return;
|
||||
} else {
|
||||
Meteor.call('add.list', listName, shared, function(err, result) {
|
||||
if (err) {
|
||||
// console.log(" ERROR adding list name: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESS adding list name.");
|
||||
$("#listNameInp").val("");
|
||||
$("#isShared").prop("checked", false);
|
||||
}
|
||||
});
|
||||
addList(listName, shared);
|
||||
}
|
||||
},
|
||||
'click .renameListMgmt' (event) {
|
||||
|
|
@ -50,16 +42,7 @@ Template.listMgmtForm.events({
|
|||
Session.set("listNameMiss", true);
|
||||
return;
|
||||
} else {
|
||||
Meteor.call('edit.list', listId, listName, shared, function(err, result) {
|
||||
if (err) {
|
||||
// console.log(" ERROR editing list name: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESS editing list name.");
|
||||
$("#listNameInp").val("");
|
||||
$("#isShared").prop("checked", false);
|
||||
Session.set("listNameEditMode", false);
|
||||
}
|
||||
});
|
||||
editList(listId, listName, shared);
|
||||
}
|
||||
},
|
||||
'submit .listAdd' (event) {
|
||||
|
|
@ -74,30 +57,36 @@ Template.listMgmtForm.events({
|
|||
return;
|
||||
} else {
|
||||
if (editMode == false) {
|
||||
Meteor.call('add.list', listName, shared, function(err, result) {
|
||||
if (err) {
|
||||
// console.log(" ERROR adding list name: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESS adding list name.");
|
||||
$("#listNameInp").val("");
|
||||
$("#isShared").prop("checked", false);
|
||||
}
|
||||
});
|
||||
addList(listName, shared);
|
||||
} else {
|
||||
Meteor.call('edit.list', listId, listName, shared, function(err, result) {
|
||||
if (err) {
|
||||
// console.log(" ERROR editing list name: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESS editing list name.");
|
||||
$("#listNameInp").val("");
|
||||
$("#isShared").prop("checked", false);
|
||||
Session.set("listNameEditMode", false);
|
||||
}
|
||||
});
|
||||
editList(listId, listName, shared);
|
||||
}
|
||||
}
|
||||
},
|
||||
'change #isCompleted' (event) {
|
||||
Session.set("showCompletedLists", true);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const addList = async(listName, shared) => {
|
||||
let result = await Meteor.callAsync('add.list', listName, shared);
|
||||
if (!result) {
|
||||
// console.log(" ERROR adding list name: ");
|
||||
} else {
|
||||
// console.log(" SUCCESS adding list name.");
|
||||
$("#listNameInp").val("");
|
||||
$("#isShared").prop("checked", false);
|
||||
}
|
||||
}
|
||||
|
||||
const editList = async(listId, listName, shared) => {
|
||||
let result = await Meteor.callAsync('edit.list', listId, listName, shared);
|
||||
if (!result) {
|
||||
// console.log(" ERROR editing list name: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESS editing list name.");
|
||||
$("#listNameInp").val("");
|
||||
$("#isShared").prop("checked", false);
|
||||
Session.set("listNameEditMode", false);
|
||||
}
|
||||
}
|
||||
|
|
@ -34,9 +34,14 @@ Template.listMgmtTbl.events({
|
|||
},
|
||||
'click .editListName' (event) {
|
||||
event.preventDefault();
|
||||
let listInfo = Lists.findOne({ _id: this._id });
|
||||
let listName = listInfo.listName;
|
||||
let listShared = listInfo.listShared;
|
||||
const lInfo = async() => {
|
||||
let listInfo = await Lists.findOneAsync({ _id: this._id });
|
||||
return listInfo;
|
||||
}
|
||||
let listData = lInfo();
|
||||
|
||||
let listName = listData.listName;
|
||||
let listShared = listData.listShared;
|
||||
$("#listNameInp").val(listName);
|
||||
if (listShared == true) {
|
||||
$("#isShared").prop("checked", true);
|
||||
|
|
@ -49,23 +54,27 @@ Template.listMgmtTbl.events({
|
|||
'click .markListComplete' (event) {
|
||||
event.preventDefault();
|
||||
let listId = this._id;
|
||||
Meteor.call('mark.complete', listId, function(err, result) {
|
||||
if (err) {
|
||||
// console.log(" ERROR marking complete: " + err);
|
||||
const markComp = async() => {
|
||||
let result = await Meteor.callAsync('mark.complete', listId);
|
||||
if (!result) {
|
||||
console.log(" ERROR marking complete.");
|
||||
} else {
|
||||
// console.log(" SUCCESS marking complete.");
|
||||
}
|
||||
});
|
||||
}
|
||||
markComp();
|
||||
},
|
||||
'click .markListNotComplete' (event) {
|
||||
event.preventDefault();
|
||||
let listId = this._id;
|
||||
Meteor.call('mark.incomplete', listId, function(err, result) {
|
||||
if (err) {
|
||||
|
||||
const markInc = async() => {
|
||||
let result = await Meteor.callAsync('mark.incomplete', listId);
|
||||
if (!result) {
|
||||
console.log("Issue marking list incomplete.");
|
||||
} else {
|
||||
|
||||
// console.log("List marked incomplete.");
|
||||
}
|
||||
});
|
||||
}
|
||||
markInc();
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue