Closed flobacher closed 7 years ago
Hi @flobacher I'm looking to do something like this, mainly I want the onClick
attribute. Would you like me to submit a PR for this?
This would be great!Thank you very much in advance!Regards, FlorianOn Jan 24, 2017 5:32 AM, Michael Baldwin notifications@github.com wrote:Hi @flobacher I'm looking to do something like this, mainly I want the onClick attribute. Would you like me to submit a PR for this?
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
Ok so I already forked the original SVGInjector repo and when I go to fork this repo, I get this warning:
I'm not sure on how best to bring my fork up to date with your fork. So I see two paths from here:
You could help advise me on where to go from here so I can submit the PR.
I provide you with the necessary code and you can make the change.
This line is the one that needs updating. Here would be the fastest, simple fix to include all attributes.
var imgData = [].filter.call(el.attributes, function (at) {
return true;
});
hey! thx.. I take a look at it.. copying of attributes, happens in other places as well, so I have to do some more changes and test afterwards.. Concerning PRs.. you can just fork my Repo, since my version will not be merged back to the original svg-repo (created ad PR and asked for it, but it was ignored ever since, so I gave up)
Too bad, this repo has a lot of great fixes to the original SVGInjector 😢 I think the original repo has been abandoned by its maintainer though.
In terms of this issue, I've found a temporary fix by wrapping svg elements in a div container, which lets me handle onClick
and other attributes. Thus, I won't be pursuing a PR on this anymore. I'll let you know if I need this and come back to it.
Thanks!
Copy all the attributes of the target HTML-Tag to the injected SVG