Skip to content

Commit b32f743

Browse files
JoelCDLJoelCDL
authored andcommitted
Add popover detection script and no-popover html class
1 parent 02cafdc commit b32f743

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/js/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import './anchor-positioning.js'
22
import './headernav.js'
33
import './mediaqueries.js'
44
import './newsreel.js'
5+
import './popover-support.js'
56
import './sidebarposts.js'
67
import './slideshow.js'
78
import './toggles.js'

src/js/popover-support.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// ***** Popover Support for CSS ***** //
2+
3+
// If the popover element is detected in the browser, remove the no-popover class from the html tag.
4+
5+
if (window.HTMLElement.prototype.hasOwnProperty('popover')) { // eslint-disable-line no-prototype-builtins
6+
document.querySelector('html').classList.remove('no-popover')
7+
}

0 commit comments

Comments
 (0)