Skip to content

Commit ee2ee4a

Browse files
author
JoelCDL
committed
Update popover support with exportable function
1 parent e6f7214 commit ee2ee4a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/js/popover-support.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
// If the popover element is detected in the browser, remove the no-popover class from the html tag.
44

5-
if (window.HTMLElement.prototype.hasOwnProperty('popover')) { // eslint-disable-line no-prototype-builtins
5+
const popoverSupport = () => {
6+
return Object.hasOwn(window.HTMLElement.prototype, 'popover')
7+
}
8+
9+
if (popoverSupport()) {
610
document.querySelector('html').classList.remove('no-popover')
711
}
12+
13+
export { popoverSupport }

0 commit comments

Comments
 (0)