Just changes.
This commit is contained in:
parent
5ba618f471
commit
8bd3fb1853
8 changed files with 214 additions and 13 deletions
33
client/Locations/locationInfo.js
Normal file
33
client/Locations/locationInfo.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { Roles } from 'meteor/roles';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { Locations } from '../../imports/api/locations.js';
|
||||
import { LocationTypes } from '../../imports/api/locationTypes.js';
|
||||
import _classCheckPrivateStaticFieldDescriptor from '@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor';
|
||||
|
||||
Template.locationInfo.onCreated(function () {
|
||||
this.subscribe("LocationTypes");
|
||||
this.subscribe("Locations");
|
||||
});
|
||||
|
||||
Template.locationInfo.onRendered(function () {
|
||||
|
||||
});
|
||||
|
||||
Template.locationInfo.helpers({
|
||||
parentLocations: function () {
|
||||
return Locations.find({ isChild: false });
|
||||
},
|
||||
childLocation: function () {
|
||||
let parId = Session.get("parentId");
|
||||
console.log("Child Loc: " + parId);
|
||||
return Locations.find({ parentId: parId });
|
||||
},
|
||||
});
|
||||
|
||||
Template.locationInfo.events({
|
||||
'click .topLevel'(e) {
|
||||
let parentId = e.currentTarget.id;
|
||||
console.log("Parent ID: " + parentId);
|
||||
Session.set("parentId", parentId);
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue