-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Sharethis implementation and Turbolinks' incompatibility #79
Comments
The new
|
thanks for the code |
Well, the butons show up and that great BUT... The current url is not properly updated. If I click Twitter (or any other) button, the Twitter page will open but the embeded URL is the one stored when the code has loaded (usually the home page) not the current page location. UPDATE: Just update the sharethis.href BEFORE calling sharethis.init So: document.addEventListener("turbolinks:load", function () {
// Note: This is undocumented API for the sharethis widget. Reload the widget when we
// visit a new page after a turbolinks load event.
if (__sharethis__ && __sharethis__.config) {
__sharethis__.href = document.location.href
__sharethis__.init(__sharethis__.config);
}
}) |
The official implementation of Sharethis, described in URL below, is deprecated.
http://reed.github.io/turbolinks-compatibility/sharethis.html
The new one is something like this:
<script type="text/javascript" src="//platform-api.sharethis.com/js/sharethis.js#property=[YOUR-PROPERTY-CODE]&product=sticky-share-buttons"></script>
How can I set this new one compatible with turbolinks?
The text was updated successfully, but these errors were encountered: