mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
37 lines
No EOL
1 KiB
JavaScript
37 lines
No EOL
1 KiB
JavaScript
import { Stores } from '../../../imports/api/stores';
|
|
|
|
Template.storeMgmtTbl.onCreated(function() {
|
|
this.subscribe("storeInfo");
|
|
});
|
|
|
|
Template.storeMgmtTbl.onRendered(function() {
|
|
Meteor.setTimeout(function() {
|
|
$('.tooltipped').tooltip();
|
|
}, 150);
|
|
});
|
|
|
|
Template.storeMgmtTbl.helpers({
|
|
mgmtStoreInfo: function() {
|
|
return Stores.find({});
|
|
},
|
|
});
|
|
|
|
Template.storeMgmtTbl.events({
|
|
'click .deleteStore' (event) {
|
|
event.preventDefault();
|
|
Meteor.call('delete.store', this._id, function(err, result) {
|
|
if (err) {
|
|
console.log(" ERROR deleting store: " + err);
|
|
} else {
|
|
console.log(" SUCCESS deleting the store.");
|
|
}
|
|
});
|
|
},
|
|
'click .editStore' (event) {
|
|
event.preventDefault();
|
|
Session.set("storeIdEdit", this._id);
|
|
let storeInfo = Stores.findOne({ _id: this._id });
|
|
$("#storeName").val(storeInfo.storeName);
|
|
Session.set("editModeStore", true);
|
|
},
|
|
}); |