shareon icon indicating copy to clipboard operation
shareon copied to clipboard

Dynamically change URL of Shareon components when prompted

Open dominiciun opened this issue 1 year ago • 3 comments

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

dominiciun avatar Jan 05 '24 07:01 dominiciun

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

kytta avatar Jan 05 '24 09:01 kytta

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.

dominiciun avatar Jan 18 '24 15:01 dominiciun

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

kytta avatar Jan 18 '24 16:01 kytta