mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-24 11:52:34 +01:00
parent
a9634b6b66
commit
b93f8a4d46
@ -12,8 +12,8 @@ class Collapsible {
|
|||||||
this.content = elem.querySelector('[collapsible-content]');
|
this.content = elem.querySelector('[collapsible-content]');
|
||||||
|
|
||||||
if (!this.trigger) return;
|
if (!this.trigger) return;
|
||||||
|
|
||||||
this.trigger.addEventListener('click', this.toggle.bind(this));
|
this.trigger.addEventListener('click', this.toggle.bind(this));
|
||||||
|
this.openIfContainsError();
|
||||||
}
|
}
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
@ -36,6 +36,13 @@ class Collapsible {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openIfContainsError() {
|
||||||
|
const error = this.content.querySelector('.text-neg');
|
||||||
|
if (error) {
|
||||||
|
this.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Collapsible;
|
export default Collapsible;
|
Loading…
Reference in New Issue
Block a user