Closed artifex404 closed 5 years ago
Sorry I couldn't run the npm tasks to run minifications, since they failed in my environment.
Hi @artifex404
Thank you for the pull request, I'll check it. But for the border you want to achieve there is a solution without adding an extra element:
// set the border on content (for expanded view)
.handorgel__content,
// set the same border to header or header button for when content is not expanded:
.handorgel__header:not(.handorgel__header--open) {
border-bottom: 5px solid red;
}
I merged the check for the header and content even though it would still be a problem if you add two extra elements instead of just one, since the two elements would be initialized as a fold instance. Also the fold push has to be outside of the if condition to be able to add already existing fold instances (I've added comments to make it more clear).
yep, that was more like a quick fix. I think the proper solution to detect the fold should check for the classes on the child elements and create the fold only if does match them?
I've added additional checks for Handorgel child elements to prevent a JS error when adding an additional element to the structure.
For example I had this structure which throwed an error:
I've added an additional element since it's not possible to add a border after header, which should be visible after the content when expanded.