web:support hidden

This commit is contained in:
pengfei.zhou
2021-04-16 14:34:16 +08:00
committed by osborn
parent f3b4c2f077
commit 900bccb98a
4 changed files with 37 additions and 5 deletions

View File

@@ -4505,6 +4505,7 @@ var doric_web = (function (exports, axios, sandbox) {
this.frameHeight = 0;
this.offsetX = 0;
this.offsetY = 0;
this._originDisplay = "";
this.transform = {};
this.context = context;
}
@@ -4516,6 +4517,7 @@ var doric_web = (function (exports, axios, sandbox) {
}
}
this.view = this.build();
this._originDisplay = this.view.style.display;
}
get paddingLeft() {
return this.padding.left || 0;
@@ -4696,6 +4698,14 @@ var doric_web = (function (exports, axios, sandbox) {
};
}
break;
case 'hidden':
if (prop === true) {
this.view.style.display = "none";
}
else {
this.view.style.display = this._originDisplay;
}
break;
default:
console.error(`Cannot blend prop for ${propName}`);
break;

File diff suppressed because one or more lines are too long

View File

@@ -103,6 +103,8 @@ export abstract class DoricViewNode {
view!: HTMLElement
_originDisplay: string = ""
transform: {
translateX?: number,
translateY?: number,
@@ -127,6 +129,7 @@ export abstract class DoricViewNode {
}
}
this.view = this.build()
this._originDisplay = this.view.style.display
}
abstract build(): HTMLElement
@@ -322,6 +325,13 @@ export abstract class DoricViewNode {
}
}
break
case 'hidden':
if (prop === true) {
this.view.style.display = "none"
} else {
this.view.style.display = this._originDisplay
}
break
default:
console.error(`Cannot blend prop for ${propName}`)
break