Closed shawnbot closed 7 years ago
Hey @jonathantneal, is there anything I can do to move this along? I've also offered to help in #101 if you want to make me a contributor.
Anyone want to review this one for me? @jonathantneal?
I'd like to use element-closest instead of the inline getSVGAncestor()
function here, but we're not set up for browserification of CJS modules yet. That's something to do re: #60 and #114 in a future update.
Thanks for the review, @timeiscoffee! I gave you access to the branch just in case you have time to get to this before I do.
@shawnbot which branch did you give me the access to? I don't see it unfortunately :(
@timeiscoffee you should have write access to this fork's use-parent
branch. I think that if you can click on the pencil icon on this page then all's good?
@shawnbot I tried to push to that use-parent
branch, but got not authorized
error. Trying to edit that README gives me:
You’re editing a file in a project you don’t have write access to. Submitting a change to this file will write it to a new branch in your fork timeiscoffee/svg4everybody, so you can send a pull request.
.
Derf, maybe that feature only works for user forks and not org forks. Sorry! I'm happy to close this PR if you have fixes ready.
Sure, I would be happy to :)
Closing as per above discussion, since https://github.com/jonathantneal/svg4everybody/pull/132 has been merged
This PR addresses the use case (heh) for
<use>
elements that aren't direct descendants of their SVG element, e.g.The changes allow for this by removing checks for direct "ancestry" (
/svg/i.test(svg.nodeName)
) and perform replacements on the<use>
element's parent, which also makes it easier to style those elements with CSS descendent selectors.We've added a test to
test/index.html
that works, and the code passes linting muster. We've ensured that thevalidate()
andfallback()
callbacks still get the SVG element as their second argument, so those should still work as expected—though some tests for those would be very welcome.