2017-05-16 16:00:32 +02:00
|
|
|
/* exported guiSkel */
|
|
|
|
/* globals domlib */
|
2017-05-16 19:18:35 +02:00
|
|
|
const guiSkel = {};
|
2017-05-15 21:59:48 +02:00
|
|
|
|
2017-05-16 19:18:35 +02:00
|
|
|
(function init () {
|
|
|
|
'use strict';
|
2017-05-15 21:59:48 +02:00
|
|
|
|
2017-05-16 19:18:35 +02:00
|
|
|
const view = guiSkel;
|
|
|
|
let container = null,
|
|
|
|
el = null;
|
2017-05-15 21:59:48 +02:00
|
|
|
|
2017-05-16 19:18:35 +02:00
|
|
|
function update () {
|
|
|
|
console.warn('Do not run dummies');
|
|
|
|
}
|
2017-05-15 21:59:48 +02:00
|
|
|
|
2017-05-16 19:18:35 +02:00
|
|
|
view.bind = function bind (bindEl) {
|
|
|
|
container = bindEl;
|
|
|
|
};
|
|
|
|
view.render = function render () {
|
|
|
|
if (!container) {
|
|
|
|
return;
|
|
|
|
} else if (el) {
|
|
|
|
container.appendChild(el);
|
|
|
|
update();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
console.log('generate new view for skel');
|
|
|
|
el = domlib.newAt(container, 'div');
|
|
|
|
|
|
|
|
update();
|
|
|
|
};
|
2017-05-16 16:00:32 +02:00
|
|
|
})();
|