mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
35 lines
No EOL
984 B
JavaScript
35 lines
No EOL
984 B
JavaScript
import { Locations } from '../../../imports/api/location.js';
|
|
|
|
Template.locMgmtTbl.onCreated(function() {
|
|
this.subscribe("myLocations");
|
|
});
|
|
|
|
Template.locMgmtTbl.onRendered(function() {
|
|
Meteor.setTimeout(function() {
|
|
$('.tooltipped').tooltip();
|
|
}, 150);
|
|
});
|
|
|
|
Template.locMgmtTbl.helpers({
|
|
locs: function() {
|
|
return Locations.find({});
|
|
}
|
|
});
|
|
|
|
Template.locMgmtTbl.events({
|
|
'click .deleteLocation' (event) {
|
|
event.preventDefault();
|
|
Session.set("deleteId", this._id);
|
|
Session.set("method", "delete.location");
|
|
Session.set("item", this.locationName);
|
|
Session.set("view", "Locations");
|
|
$('#modalDelete').modal('open');
|
|
},
|
|
'click .editLocation' (event) {
|
|
event.preventDefault();
|
|
Session.set("locEditMode", true);
|
|
Session.set("locEditId", this._id);
|
|
let locInfo = Locations.findOne({ _id: this._id });
|
|
$("#locNameInp").val(locInfo.locationName);
|
|
},
|
|
}); |