kytta / shareon

📯 Lightweight, stylish, and ethical share buttons for popular social networks
https://shareon.js.org/
MIT License
464 stars 23 forks source link

Dynamically change URL of Shareon components when prompted #103

Open dominiciun opened 8 months ago

dominiciun commented 8 months ago

In some cases there are cases in which the location.href is not meant to be the shareable url.

kytta commented 8 months ago

You can use the data-url attribute on either the button or the button container (the one with class shareon). See the documentation here

dominiciun commented 7 months ago

I have tried this. It seems to only change the url on onload. When the attribute is changed after element is loaded shareon will not catch on to it.

kytta commented 7 months ago

Oh, yes, you have to call Shareon.init() after every update. For some reason, it's not in the documentation... I'll have to adjust that