Added ability to show toggle button for Drawer.

This commit is contained in:
Matt Mo 2021-01-05 10:32:39 -08:00
parent 07b74e39b7
commit d9bca5d579

View File

@ -121,6 +121,7 @@ class Drawer extends IgniteElement {
get properties() {
return {
show: false,
showToggleButton: true,
responsive: new IgniteProperty(true, (oldValue, value) => {
//If responsive is false and mobile is true, set mobile to false.
if (!value && this.mobile) {
@ -162,7 +163,7 @@ class Drawer extends IgniteElement {
.child(
new button()
.class("open-btn")
.show([this.mobile, this.show], (mobile, show) => mobile && !show)
.show([this.mobile, this.show, this.showToggleButton], (mobile, show, toggle) => mobile && !show && toggle)
.onClick(() => this.show = true)
.child("<i class='fas fa-chevron-right'></i>"),
new div()
@ -175,7 +176,7 @@ class Drawer extends IgniteElement {
.child(
new button()
.class("close-btn")
.show([this.mobile, this.show], (mobile, show) => mobile && show)
.show([this.mobile, this.show, this.toggle], (mobile, show, toggle) => mobile && show && toggle)
.onClick(() => this.show = false)
.child("<i class='fas fa-chevron-left'></i>")
)