Skip to content
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

Arbitrary button node structure (deeper than 1 level) #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

max-morawski-photo
Copy link

Simple change to enable share buttons with a structure deeper than 1 level currently supported. My use case is:

<a data-pin-do="buttonBookmark" data-pin-custom="true" ..>
  <div ..>
    <svg ..>
      ..
    </svg>
  </div>
</a>

In this case, click events go to the node and the stock Pinterest code does not work as expected.

@kentbrew
Copy link
Contributor

Hi, sorry for dead air here. I'm no longer at Pinterest and (since I was the only one monitoring this repo) I doubt a reply will be forthcoming. Your change seems reasonable to me, although I would probably recommend a <span> and not a <div> inside the link, in case we're on an elderly page that needs to pass W3C validation.

@@ -884,8 +884,8 @@
el = $.f.getEl(v);
if (el) {
log = $.f.getData(el, "log");
// custom buttons with child nodes may not pass clicks; check one level up
if (!log && el.parentNode) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cambiar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants