Skip to content

Commit

Permalink
Allowing re-parsing of inserted Pinterest links
Browse files Browse the repository at this point in the history
Links added to the DOM, properly tagged for Socialite, would not be
re-parsed as buttons by the Pinterest script.  This commit adds a
'data-pin-build' parameter to the pinit.js script (which exposes the
parsePinBtns function) and replaces the reloadNetwork call with a call
to this function.
  • Loading branch information
Joshua McGee committed Mar 25, 2014
1 parent 71e756e commit 44d575b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/socialite.pinterest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

Socialite.network('pinterest', {
script: {
src: '//assets.pinterest.com/js/pinit.js'
src: '//assets.pinterest.com/js/pinit.js',
'data-pin-build': 'parsePinBtns'
}
});

Expand Down Expand Up @@ -39,7 +40,7 @@
el.setAttribute('count-layout', instance.el.getAttribute('data-count-layout') || 'horizontal');
instance.el.appendChild(el);
if (Socialite.networkReady('pinterest')) {
Socialite.reloadNetwork('pinterest');
window.parsePinBtns();
}
}
});
Expand Down

0 comments on commit 44d575b

Please sign in to comment.