Skip to content

Commit

Permalink
fix: remove content margin when drawer is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
ngonzalezpazFC authored and mlopezFC committed Jun 23, 2022
1 parent 7646cc2 commit 7a434b1
Showing 1 changed file with 47 additions and 14 deletions.
61 changes: 47 additions & 14 deletions src/fc-applayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,28 +218,61 @@ export class FcAppLayoutElement extends ThemableElement {
}

_updateMargin() {
let marginWidth = this.drawer.clientWidth + "px";
if (this.drawerPersistent) {
let marginWidth = this.drawer.clientWidth + "px";
if (!this.drawer.opened) {
this.content.style.marginLeft = "0px";
}
if (!this.drawerBelowHeader) {
if (this.drawerAlign=="right") {
this.header.style.marginRight = marginWidth;
//TRUE TRUE
if(this.drawerBelowHeader){
if(this.drawer.opened) {
if (this.drawerAlign == "right") {
this.header.style.marginRight = "0px";
this.content.style.marginRight = marginWidth;
} else {
this.header.style.marginLeft = "0px";
this.content.style.marginLeft = marginWidth;
}
} else {
if (this.drawerAlign == "right") {
this.header.style.marginRight = "0px";
this.content.style.marginRight = "0px";
} else {
this.header.style.marginLeft = "0px";
this.content.style.marginLeft = "0px";
}
}
} else {//TRUE FALSE
if(this.drawer.opened) {
if (this.drawerAlign == "right") {
this.header.style.marginRight = marginWidth;
this.content.style.marginRight = marginWidth;
} else {
this.header.style.marginLeft = marginWidth;
this.content.style.marginLeft = marginWidth;
}
} else {
this.header.style.marginLeft = marginWidth;
if (this.drawerAlign == "right") {
this.header.style.marginRight = "0px";
this.content.style.marginRight = "0px";
} else {
this.header.style.marginLeft = "0px";
this.content.style.marginLeft = "0px";
}
}
}
if (this.drawerAlign=="right") {
this.content.style.marginRight = marginWidth;
} else {
this.content.style.marginLeft = marginWidth;

} else {
//FALSE TRUE
//FALSE FALSE
if (this.drawerAlign == "right") {
this.header.style.marginRight = "0px";
this.content.style.marginRight = "0px";
} else {
this.header.style.marginLeft = "0px";
this.content.style.marginLeft = "0px";
}
}
}
}

}

declare global {
interface HTMLElementTagNameMap {
'fc-applayout': FcAppLayoutElement;
Expand Down

0 comments on commit 7a434b1

Please sign in to comment.