mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-10-30 02:18:16 +08:00
Add code to load glyph data into Meteor
This commit is contained in:
31
client/progress.js
Normal file
31
client/progress.js
Normal file
@ -0,0 +1,31 @@
|
||||
Template.navbar.events({
|
||||
'click #reload-button': function() {
|
||||
Meteor.call('reload');
|
||||
},
|
||||
});
|
||||
|
||||
Template.progress.helpers({
|
||||
percent: function() {
|
||||
return Math.round(100*Session.get('progress.value'));
|
||||
},
|
||||
});
|
||||
|
||||
Tracker.autorun(function() {
|
||||
if (Session.get('progress.show')) {
|
||||
$('#progress').modal({background: 'static', keyboard: false});
|
||||
} else {
|
||||
$('#progress').modal('hide');
|
||||
}
|
||||
});
|
||||
|
||||
Tracker.autorun(function() {
|
||||
var progress = Progress.findOne();
|
||||
if (progress) {
|
||||
Session.set('progress.show', true);
|
||||
Session.set('progress.value', progress.value);
|
||||
} else {
|
||||
Session.set('progress.show', false);
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.subscribe('progress');
|
||||
Reference in New Issue
Block a user