refactor: position
This commit is contained in:
parent
84eaa069a8
commit
d69f1418e8
|
@ -15,6 +15,14 @@ export default () => class DomNode extends decorate(Trait) {
|
||||||
|
|
||||||
#scheduledRuleApplication = true;
|
#scheduledRuleApplication = true;
|
||||||
|
|
||||||
|
static defaultParams() {
|
||||||
|
return {
|
||||||
|
style: {
|
||||||
|
position: 'absolute',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static defaultState() {
|
static defaultState() {
|
||||||
return {
|
return {
|
||||||
parentNode: null,
|
parentNode: null,
|
||||||
|
@ -82,7 +90,9 @@ export default () => class DomNode extends decorate(Trait) {
|
||||||
await super.load(json);
|
await super.load(json);
|
||||||
if ('client' === process.env.SIDE) {
|
if ('client' === process.env.SIDE) {
|
||||||
this.entity.node = window.document.createElement('entity');
|
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();
|
this.applyStyleRules();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user