sidepanel: pass button reference to action callback
This commit is contained in:
parent
4cbdce3add
commit
7264163670
1 changed files with 1 additions and 1 deletions
|
|
@ -124,7 +124,7 @@ for (let i in sidepanelData) {
|
|||
let actionData = data.actions[j],
|
||||
element = DOM.create(`<a class="btn ${actionData.class || ''}">${actionData.title}</a>`)
|
||||
|
||||
if (actionData.action) element.addEventListener('click', actionData.action)
|
||||
if (actionData.action) element.addEventListener('click', ()=>{actionData.action(element)})
|
||||
|
||||
wrapper.appendChild(element)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue