Skip to content

Commit

Permalink
fix custom class support on map buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Bladen-Clark committed Aug 16, 2023
1 parent 7cb991c commit ea8124f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/js/components/map/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function createMapButton (buttonContainer, uri, options) {
}
button.id = mapId + '-btn'
button.innerHTML = `<span class="defra-button-secondary__icon"><svg focusable="false" width="15" height="20" viewBox="0 0 15 20"><path d="M15,7.5c0.009,3.778 -4.229,9.665 -7.5,12.5c-3.271,-2.835 -7.509,-8.722 -7.5,-12.5c0,-4.142 3.358,-7.5 7.5,-7.5c4.142,0 7.5,3.358 7.5,7.5Zm-7.5,5.461c3.016,0 5.461,-2.445 5.461,-5.461c0,-3.016 -2.445,-5.461 -5.461,-5.461c-3.016,0 -5.461,2.445 -5.461,5.461c0,3.016 2.445,5.461 5.461,5.461Z" fill="currentColor"/></svg></span><span class="defra-button-secondary__text">${options.btnText || 'View map'}</span><span class="govuk-visually-hidden">(Visual only)</span>`
button.className = options.btnClass || (options.btnType === 'link' ? 'defra-link-icon-s' : 'defra-button-secondary')
button.className = options.btnClasses || (options.btnType === 'link' ? 'defra-link-icon-s' : 'defra-button-secondary')

if (options.data && options.data.button) {
button.setAttribute('data-journey-click', options.data.button)
Expand Down

0 comments on commit ea8124f

Please sign in to comment.