refactor: position

This commit is contained in:
cha0s 2021-02-13 10:23:25 -06:00
parent 84eaa069a8
commit d69f1418e8

View File

@ -15,6 +15,14 @@ export default () => class DomNode extends decorate(Trait) {
#scheduledRuleApplication = true;
static defaultParams() {
return {
style: {
position: 'absolute',
},
};
}
static defaultState() {
return {
parentNode: null,
@ -82,7 +90,9 @@ export default () => class DomNode extends decorate(Trait) {
await super.load(json);
if ('client' === process.env.SIDE) {
this.entity.node = window.document.createElement('entity');
this.entity.node.style.position = 'absolute';
Object.entries(this.params.style).forEach(([key, value]) => {
this.entity.node.style[key] = value;
});
this.applyStyleRules();
}
}