Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.computation = Tracker.autorun(() => {
if (this._ismounted) {
this.setState({
data: Session.get("UNIT_RESULTS"),
resultsCount: Session.get("UNIT_RESULTS_COUNT")
});
}
});
// don't clean the courseId on unmount
getMonth: function () {
return moment().month(lastMonth).locale(Session.get('activeLanguage')).format('MMMM');
},
getYear: function () {
function editBack() {
activeEditMode = 1;
$('#contentEditor').focus();
$('#contentEditor').attr('tabindex', 6);
$('#contentEditor').val(Session.get('backText'));
$('#editor').attr('data-content', Session.get('backText'));
$('#editBack').removeClass('btn-default').addClass('btn-primary');
$('#editFront').removeClass('btn-primary').addClass('btn-default');
$('#editHint').removeClass('btn-primary').addClass('btn-default');
turnBack();
}
Template.mbti_roles.onRendered(function() {
let s = Session.get('records');
if(!s) {
Session.set('records', plotActivities());
}
});
'click #menuButton'() {
Session.set('sidebarMenuSelectedId', this.id);
if (typeof this.id === 'string') {
toggleSelectedItem(Session.get('menuDelegates'));
} else {
toggleSelectedItem(Session.get('menuDecisions'));
}
},
});
Template.cardset.onCreated(function () {
CardVisuals.toggleFullscreen(true);
if (Session.get('activeCardset') === undefined || Session.get('activeCardset')._id !== Router.current().params._id) {
Session.set('activeCardset', Cardsets.findOne(Router.current().params._id));
Session.set('activeCard', undefined);
}
if (Number(Session.get('activeCard')) === Number(-1)) {
Session.set('activeCard', undefined);
}
Session.set('shuffled', Cardsets.findOne(Router.current().params._id).shuffled);
Session.set('cameFromEditMode', false);
CardNavigation.toggleVisibility(true);
Session.set('hideSidebar', false);
});
timestamp() {
if (Session.get('contract')) {
let d = Date();
if (Session.get('contract').timestamp !== undefined) {
d = Session.get('contract').timestamp;
return d.format('{Month} {d}, {yyyy}');
}
}
return '';
},
});
content() {
return Session.get(this.id).template;
},
dataObject() {
const _setBallot = (contractId, ballot) => {
let manager = [];
let found = false;
if (Session.get('ballotManager')) {
manager = Session.get('ballotManager');
}
for (const i in manager) {
if (manager[i].contractId === contractId) {
manager[i].candidateBallot = ballot;
found = true;
break;
}
}
if (!found) {
manager.push({
contractId,
candidateBallot: ballot,
});
}