Skip to content

Commit 16d6419

Browse files
authored
Merge pull request #3644 from Uninett/fix/popover-sometimes-throws-error-on-initialization
Fix bug where popover initialization sometimes throws error
2 parents 7de9a7c + 02ba902 commit 16d6419

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/nav/web/static/js/src/plugins/popover.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ define([], function () {
22
"use strict";
33

44
function init() {
5+
if (!document.body) {
6+
document.addEventListener('DOMContentLoaded', init);
7+
return;
8+
}
9+
510
// Prevent double initialization
611
if (document.body.dataset.popoverInitialized) return;
712
document.body.dataset.popoverInitialized = "true";

0 commit comments

Comments
 (0)