Add toggle alignment option into Et2Details widget

This commit is contained in:
Hadi Nategh 2022-08-04 11:40:27 +02:00
parent 8ff468520d
commit 2369daa2e8

View File

@ -82,6 +82,13 @@ export class Et2Details extends Et2Widget(SlDetails)
*/
hoist: {
type: Boolean
},
/**
* set toggle alignment either to left or right. Default is right alignment.
*/
toggleAlign: {
type: String
}
}
}
@ -90,6 +97,7 @@ export class Et2Details extends Et2Widget(SlDetails)
{
super();
this.toggleOnHover = false;
this.toggleAlign = 'right';
this.hoist = false;
}
@ -106,6 +114,10 @@ export class Et2Details extends Et2Widget(SlDetails)
{
this.shadowRoot.querySelector('.details').classList.add('hoist');
}
if (this.toggleAlign === 'left')
{
this.shadowRoot.querySelector('.details__summary-icon').style.order = -1;
}
});
}