mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 16:28:50 +00:00
37 lines
No EOL
1 KiB
JavaScript
37 lines
No EOL
1 KiB
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();
|
|
Meteor.call('delete.location', this._id, function(err, result) {
|
|
if (err) {
|
|
console.log(" ERROR deleting location: " + err);
|
|
} else {
|
|
console.log(" SUCCESS deleting the location.");
|
|
}
|
|
});
|
|
},
|
|
'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);
|
|
},
|
|
}); |