mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
35 lines
No EOL
993 B
JavaScript
35 lines
No EOL
993 B
JavaScript
import { Categories } from '../../../imports/api/category.js';
|
|
|
|
Template.catMgmtTbl.onCreated(function() {
|
|
this.subscribe("myCategories");
|
|
});
|
|
|
|
Template.catMgmtTbl.onRendered(function() {
|
|
Meteor.setTimeout(function() {
|
|
$('.tooltipped').tooltip();
|
|
}, 150);
|
|
});
|
|
|
|
Template.catMgmtTbl.helpers({
|
|
cats: function() {
|
|
return Categories.find({});
|
|
}
|
|
});
|
|
|
|
Template.catMgmtTbl.events({
|
|
'click .deleteCategory' (event) {
|
|
event.preventDefault();
|
|
Session.set("deleteId", this._id);
|
|
Session.set("method", "delete.category");
|
|
Session.set("item", this.categoryName);
|
|
Session.set("view", "Categories");
|
|
$('#modalDelete').modal('open');
|
|
},
|
|
'click .editCategory' (event) {
|
|
event.preventDefault();
|
|
Session.set("categoryEditId", this._id);
|
|
Session.set("catEditMode", true);
|
|
let catInfo = Categories.findOne({ _id: this._id });
|
|
$("#catNameInp").val(catInfo.categoryName);
|
|
}
|
|
}); |