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

Gear button on pile not working #16

Open
buuhuu opened this issue Mar 15, 2024 · 0 comments
Open

Gear button on pile not working #16

buuhuu opened this issue Mar 15, 2024 · 0 comments

Comments

@buuhuu
Copy link
Collaborator

buuhuu commented Mar 15, 2024

When I click the gear icon in the pile here https://main--exlm--buuhuu.hlx.page/en/dirk-demo nothing happens.

That seems to be related to this piece of code: https://github.com/adobe/aem-experimentation/blob/main/src/preview.js#L52-L75

  const actions = typeof header === 'object'
    ? (header.actions || []).map((action) => (action.href
      ? `<div class="hlx-button"><a href="${action.href}">${action.label}</a></div>`
      : `<div class="hlx-button"><a href="#">${action.label}</a></div>`))
    : [];
  // ...
  const buttons = [...popup.querySelectorAll('.hlx-popup-header-actions .hlx-button a')];
  actions.forEach((action, index) => {
    if (action.onclick) {
      buttons[index].addEventListener('click', action.onclick);
    }
  });

While the only item in header.actions has an onclick handler, the html string in the actions array does not.

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

No branches or pull requests

1 participant