use templates in poll.js

This commit is contained in:
ansuz
2017-06-27 15:38:12 +02:00
parent bb74935b08
commit bdca6b10c2
3 changed files with 69 additions and 48 deletions

View File

@@ -119,11 +119,21 @@ $(function () {
if (isMainApp()) {
if (typeof(Pages[pathname]) === 'function') {
$('body').html(h('body', Pages[pathname]()).innerHTML);
setTimeout(function () {
require(['/whiteboard/main.js'], function () {
$('body').removeClass('noscroll');
if (/whiteboard/.test(pathname)) {
setTimeout(function () {
require(['/whiteboard/main.js'], function () {
$('body').removeClass('noscroll');
});
});
});
} else if (/poll/.test(pathname)) {
setTimeout(function () {
require(['/poll/main.js'], function () {
$('body').removeClass('noscroll');
console.log("TEMPLATE!");
});
});
}
return;
}
}