From d00803e90fceff49c99eaeed28a5ee1bdb160d2d Mon Sep 17 00:00:00 2001 From: Niko Date: Wed, 23 Feb 2022 10:49:56 +0100 Subject: [PATCH] Preload quiz.index template on pages.home quizs loading --- web/src/app/js/app.js | 1 + web/src/app/js/pages/home.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/app/js/app.js b/web/src/app/js/app.js index 6553477..e844bbc 100644 --- a/web/src/app/js/app.js +++ b/web/src/app/js/app.js @@ -35,6 +35,7 @@ app.template = { return app.template.get(name) !== undefined; }, load: function(name, cback) { + cback = cback || function() {}; file = app.vars.js_dir + '/templates/' + name.replaceAll('.', '/') + '.html'; if (app.template.get(name) !== undefined) diff --git a/web/src/app/js/pages/home.js b/web/src/app/js/pages/home.js index a07d69a..ae4a9cb 100644 --- a/web/src/app/js/pages/home.js +++ b/web/src/app/js/pages/home.js @@ -10,6 +10,7 @@ app.pages.home = { await app.template.loadMany(['home.quiz_item']); app.pages.home.data.quizs = json; app.pages.home.paint('quizs', json); + app.template.load('quiz.index'); }); }); }, @@ -37,7 +38,6 @@ app.pages.home = { const item = data[i]; var tpl = app.template.fill(item, app.template.get('home.quiz_item'), function(k,v) { - console.log(v); if (k === 'from.name') return app.emoji.expand(capitalize(v)); }); if (item.responses === undefined)