Skip to content

Commit

Permalink
Merge pull request #8 from qlik-oss/nullCheckLegend
Browse files Browse the repository at this point in the history
Null check legend buttons
  • Loading branch information
AlbertBackenhof authored Jun 17, 2019
2 parents 558bf5f + e32bac5 commit 67752df
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/bridgepicassospec.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,14 @@ export default function (element, layout, direction, isEditMode) {
displayOrder: 2
},
mounted() {
element.querySelector('[data-component-key=legend][data-action=next]').addEventListener(
'click', () => this.emit('next'));
element.querySelector('[data-component-key=legend][data-action=prev]').addEventListener(
'click', () => this.emit('prev'));
const nextEl = element.querySelector('[data-component-key=legend][data-action=next]');
if (nextEl) {
nextEl.addEventListener('click', () => this.emit('next'));
}
const prevEl = element.querySelector('[data-component-key=legend][data-action=prev]');
if (prevEl) {
prevEl.addEventListener('click', () => this.emit('prev'));
}
},
settings: {
layout: { // Optional
Expand Down

0 comments on commit 67752df

Please sign in to comment.