Many chcanges, but version 0.1.0 is ready to be cut.

This commit is contained in:
Brian McGonagill 2022-08-23 13:41:21 -05:00
parent 42643a37f5
commit 6e37ae8c74
46 changed files with 1038 additions and 273 deletions

View file

@ -22,17 +22,19 @@ Template.listMgmtForm.events({
'click .saveListMgmt' (event) {
event.preventDefault();
let listName = $("#listNameInp").val();
let shared = $("#isShared").prop('checked');
if (listName == null || listName == "") {
Session.set("listNameMiss", true);
return;
} else {
Meteor.call('add.list', listName, function(err, result) {
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);
}
});
}
@ -40,18 +42,20 @@ Template.listMgmtForm.events({
'click .renameListMgmt' (event) {
event.preventDefault();
let listName = $("#listNameInp").val();
let shared = $("#isShared").prop('checked');
let listId = Session.get("listItemId");
if (listName == null || listName == "") {
Session.set("listNameMiss", true);
return;
} else {
Meteor.call('edit.list', listId, listName, function(err, result) {
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);
}
});
@ -60,6 +64,7 @@ Template.listMgmtForm.events({
'submit .listAdd' (event) {
event.preventDefault();
let editMode = Session.get("listNameEditMode");
let shared = $("#isShared").prop("checked");
let listName = $("#listNameInp").val();
let listId = Session.get("listItemId");
@ -68,21 +73,23 @@ Template.listMgmtForm.events({
return;
} else {
if (editMode == false) {
Meteor.call('add.list', listName, function(err, result) {
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);
}
});
} else {
Meteor.call('edit.list', listId, listName, function(err, result) {
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);
}
});