Skip to content

Commit a9cef6b

Browse files
committed
fix the blur
1 parent 2dcdc8a commit a9cef6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

javascripts/toggle-images.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ export default function () {
2525
// The button is hidden by default so it doesn't appear on browsers with JS disabled.
2626
// If there are images on a docs page and JS is enabled, display the toggle button.
2727
toggleImagesBtn.removeAttribute('hidden')
28-
// Remove focus from the button after click so the tooltip does not stay displayed.
29-
toggleImagesBtn.blur()
3028

3129
// Look for a cookie with image visibility preference; otherwise, use the default.
3230
const hideImagesPreferred = (Cookies.get('hideImagesPreferred') === 'true') || hideImagesByDefault
@@ -118,6 +116,9 @@ export default function () {
118116
toggleImages(images, 'show', tooltipHideSingle)
119117
}
120118

119+
// Remove focus from the button after click so the tooltip does not stay displayed.
120+
toggleImagesBtn.blur()
121+
121122
// Save this preference as a cookie.
122123
Cookies.set('hideImagesPreferred', showOnNextClick)
123124

0 commit comments

Comments
 (0)