mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-11-02 21:41:28 +08:00
Hack together fraction-completed bar
This commit is contained in:
@ -7,10 +7,12 @@ var COLORS = ['#0074D9', '#2ECC40', '#FFDC00', '#FF4136', '#7FDBFF',
|
||||
|
||||
function change_glyph(method, glyph) {
|
||||
glyph = glyph || Session.get('glyph.data');
|
||||
Meteor.call(method, glyph, function(error, data) {
|
||||
Meteor.call(method, glyph, function(err, data) {
|
||||
data = fill_glyph_fields(data);
|
||||
Session.set('glyph.data', data);
|
||||
if (method !== 'save_glyph') {
|
||||
if (method === 'save_glyph') {
|
||||
refresh_fraction_verified();
|
||||
} else {
|
||||
Session.set('glyph.show_strokes', data.manual.verified);
|
||||
}
|
||||
});
|
||||
@ -25,6 +27,14 @@ function fill_glyph_fields(glyph) {
|
||||
return glyph;
|
||||
}
|
||||
|
||||
function refresh_fraction_verified() {
|
||||
Meteor.call('get_fraction_verified', function(err, data) {
|
||||
if (!err) {
|
||||
Session.set('glyph.fraction_verified', data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.get_glyph = function(name) {
|
||||
change_glyph('get_glyph', name);
|
||||
}
|
||||
@ -243,4 +253,5 @@ Meteor.startup(function() {
|
||||
if (!Session.get('glyph.data')) {
|
||||
change_glyph('get_next_glyph');
|
||||
}
|
||||
refresh_fraction_verified();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user