pmg-gui/js/mobile/component.js
Dominik Csapak 43f0b189d9 close #1671: implement mobile UI for quarantine
this patch implements a UI for the Quarantine, designed to
be looked at on mobile phones

for this we use Framework7 instead of extjs, since it has much more
features and looks more native on phones

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-19 10:04:19 +01:00

27 lines
533 B
JavaScript

class Component {
constructor(config = {}) {
var me = this;
me.config = config;
me.data = config.data || {};
me.tpl = me.config.tpl || '<div class="component"></div>';
}
getTpl() {
var me = this;
if (!me._compiledtpl) {
me._compiledtpl = Template7.compile(me.tpl);
}
return me._compiledtpl;
}
getEl(data) {
var me = this;
if (data === undefined && me._el) {
return me._el;
} else if (data !== undefined) {
me.data =data;
}
me._el = Dom7(me.getTpl()(me.data));
return me._el;
}
}