mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-10-28 13:08:10 +08:00
28 lines
634 B
JavaScript
28 lines
634 B
JavaScript
"use strict";
|
|
|
|
Template.modal.helpers({
|
|
percent: () => {
|
|
const value = Session.get('modal.value');
|
|
return Math.round(100*(value === undefined ? 1 : value));
|
|
},
|
|
text: () => Session.get('modal.text'),
|
|
});
|
|
|
|
Tracker.autorun(function() {
|
|
if (Session.get('modal.show')) {
|
|
$('#modal').modal({background: 'static', keyboard: false});
|
|
} else {
|
|
$('#modal').modal('hide');
|
|
}
|
|
});
|
|
|
|
Tracker.autorun(function() {
|
|
const value = Session.get('modal.value');
|
|
Session.set('modal.show', value !== undefined);
|
|
});
|
|
|
|
Meteor.startup(function() {
|
|
Session.set('modal.show', false);
|
|
Session.set('modal.value', undefined);
|
|
});
|