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
40
client/Menus/mainMenuTbl.js
Normal file
40
client/Menus/mainMenuTbl.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { Menus } from '../../imports/api/menu.js';
|
||||
|
||||
Template.mainMenuTbl.onCreated(function() {
|
||||
this.subscribe("myMenus");
|
||||
});
|
||||
|
||||
Template.mainMenuTbl.onRendered(function() {
|
||||
Session.set("menuEditMode", false);
|
||||
});
|
||||
|
||||
Template.mainMenuTbl.helpers({
|
||||
myMenus: function() {
|
||||
return Menus.find({});
|
||||
}
|
||||
});
|
||||
|
||||
Template.mainMenuTbl.events({
|
||||
// 'click #addMenu' (event) {
|
||||
// event.preventDefault();
|
||||
// $('#modalMenu').modal('open');
|
||||
// },
|
||||
'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 menuId = event.currentTarget.id;
|
||||
if (menuId == "addMenu") {
|
||||
$('#modalMenu').modal('open');
|
||||
} else {
|
||||
console.log("menuId is: " + menuId);
|
||||
Session.set("menuId", menuId);
|
||||
Meteor.setTimeout(function() {
|
||||
FlowRouter.go('/menuitems');
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue