Skip to content

Commit 6169b7f

Browse files
committed
Add web components compatibility (polymer) - merging usablica#543 manually.
1 parent eb9fb91 commit 6169b7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

intro.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@
10401040

10411041
var parentElm = targetElement.element.parentNode;
10421042
while (parentElm != null) {
1043-
if (parentElm.tagName.toLowerCase() === 'body') break;
1043+
if (!parentElm.tagName || parentElm.tagName.toLowerCase() === 'body') break;
10441044

10451045
//fix The Stacking Contenxt problem.
10461046
//More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context
@@ -1112,7 +1112,7 @@
11121112
function _isFixed (element) {
11131113
var p = element.parentNode;
11141114

1115-
if (p.nodeName === 'HTML') {
1115+
if (!p || p.nodeName === 'HTML') {
11161116
return false;
11171117
}
11181118

@@ -1175,7 +1175,7 @@
11751175
overlayLayer.className = 'introjs-overlay';
11761176

11771177
//check if the target element is body, we should calculate the size of overlay layer in a better way
1178-
if (targetElm.tagName.toLowerCase() === 'body') {
1178+
if (!targetElm.tagName || targetElm.tagName.toLowerCase() === 'body') {
11791179
styleText += 'top: 0;bottom: 0; left: 0;right: 0;position: fixed;';
11801180
overlayLayer.setAttribute('style', styleText);
11811181
} else {

0 commit comments

Comments
 (0)