add guard to show/hide methods

pull/463/head
Cory LaViska 2021-05-26 12:43:30 -04:00
rodzic ee9ce8a87b
commit fc5a21f57d
5 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -74,7 +74,7 @@ export default class SlAlert extends LitElement {
/** Shows the alert. */
async show() {
if (!this.hasInitialized) {
if (!this.hasInitialized || this.open) {
return;
}
@ -100,7 +100,7 @@ export default class SlAlert extends LitElement {
/** Hides the alert */
async hide() {
if (!this.hasInitialized) {
if (!this.hasInitialized || !this.open) {
return;
}

Wyświetl plik

@ -82,7 +82,7 @@ export default class SlDetails extends LitElement {
/** Shows the alert. */
async show() {
if (!this.hasInitialized || this.disabled) {
if (!this.hasInitialized || this.open || this.disabled) {
return;
}
@ -106,7 +106,7 @@ export default class SlDetails extends LitElement {
/** Hides the alert */
async hide() {
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
if (!this.hasInitialized || this.disabled) {
if (!this.hasInitialized || !this.open || this.disabled) {
return;
}

Wyświetl plik

@ -118,7 +118,7 @@ export default class SlDialog extends LitElement {
/** Shows the dialog */
async show() {
if (!this.hasInitialized) {
if (!this.hasInitialized || this.open) {
return;
}
@ -166,7 +166,7 @@ export default class SlDialog extends LitElement {
/** Hides the dialog */
async hide() {
if (!this.hasInitialized) {
if (!this.hasInitialized || !this.open) {
return;
}

Wyświetl plik

@ -132,7 +132,7 @@ export default class SlDrawer extends LitElement {
/** Shows the drawer */
async show() {
if (!this.hasInitialized) {
if (!this.hasInitialized || this.open) {
return;
}
@ -183,7 +183,7 @@ export default class SlDrawer extends LitElement {
/** Hides the drawer */
async hide() {
if (!this.hasInitialized) {
if (!this.hasInitialized || !this.open) {
return;
}

Wyświetl plik

@ -332,7 +332,7 @@ export default class SlDropdown extends LitElement {
/** Shows the dropdown panel */
async show() {
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
if (!this.hasInitialized) {
if (!this.hasInitialized || this.open) {
return;
}
@ -360,7 +360,7 @@ export default class SlDropdown extends LitElement {
/** Hides the dropdown panel */
async hide() {
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
if (!this.hasInitialized) {
if (!this.hasInitialized || !this.open) {
return;
}