mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Added Menu List and the Menu Table view.
This commit is contained in:
parent
25ce44d9cf
commit
3290b3086a
16 changed files with 401 additions and 0 deletions
42
client/Menus/addMenuModal.js
Normal file
42
client/Menus/addMenuModal.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Menus } from '../../imports/api/menu.js';
|
||||
|
||||
Template.addMenuModal.onCreated(function() {
|
||||
this.subscribe("myMenus");
|
||||
});
|
||||
|
||||
Template.addMenuModal.onRendered(function() {
|
||||
Session.set("menuNameErr", false);
|
||||
$('.modal').modal();
|
||||
});
|
||||
|
||||
Template.addMenuModal.helpers({
|
||||
menuNameErr: function() {
|
||||
return Session.get("menuNameErr");
|
||||
},
|
||||
editMode: function() {
|
||||
return Session.get("menuEditMode");
|
||||
}
|
||||
});
|
||||
|
||||
Template.addMenuModal.events({
|
||||
'click .saveMenu' (event) {
|
||||
event.preventDefault();
|
||||
let menuName = $("#menuNameInp").val();
|
||||
if (menuName == "" || menuName == null) {
|
||||
Session.set("menuNameErr", true);
|
||||
} else {
|
||||
Meteor.call("add.menu", menuName, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR adding menu: " + err);
|
||||
} else {
|
||||
console.log(" SUCCESS adding menu.");
|
||||
$("#menuNameInp").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .renameMenu' (event) {
|
||||
event.preventDefault();
|
||||
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue