]>
BookStack Code Mirror - bookstack/blobdiff - resources/js/components/collapsible.js
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #2791 from BookStackApp/attachments_open_in_browser
[bookstack]
/
resources
/
js
/
components
/
collapsible.js
diff --git
a/resources/js/components/collapsible.js
b/resources/js/components/collapsible.js
index 464f394c1e7e42a8d1dc568c94568d53f1498819..544f91008c7d13eaeec88a9f119ebfb47e839a85 100644
(file)
--- a/
resources/js/components/collapsible.js
+++ b/
resources/js/components/collapsible.js
@@
-12,8
+12,8
@@
class Collapsible {
this.content = elem.querySelector('[collapsible-content]');
if (!this.trigger) return;
this.content = elem.querySelector('[collapsible-content]');
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.text-small');
+ if (error) {
+ this.open();
+ }
+ }
+
}
export default Collapsible;
\ No newline at end of file
}
export default Collapsible;
\ No newline at end of file