File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 120
120
121
121
} else {
122
122
//use steps from data-* annotations
123
- var allIntroSteps = targetElm . querySelectorAll ( '*[data-intro]' ) ;
123
+ var allIntroSteps = [ targetElm . querySelector ( '*[data-intro]' ) ] ;
124
+
124
125
//if there's no element to intro
125
- if ( allIntroSteps . length < 1 ) {
126
+ if ( allIntroSteps . length < 1 || ! allIntroSteps [ 0 ] ) {
126
127
return false ;
127
128
}
128
129
1015
1016
1016
1017
var parentElm = targetElement . element . parentNode ;
1017
1018
while ( parentElm != null ) {
1018
- if ( parentElm . tagName . toLowerCase ( ) === 'body' ) break ;
1019
+ if ( ! parentElm . tagName || parentElm . tagName . toLowerCase ( ) === 'body' ) break ;
1019
1020
1020
1021
//fix The Stacking Contenxt problem.
1021
1022
//More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context
1087
1088
function _isFixed ( element ) {
1088
1089
var p = element . parentNode ;
1089
1090
1090
- if ( p . nodeName === 'HTML' ) {
1091
+ if ( ! p || p . nodeName === 'HTML' ) {
1091
1092
return false ;
1092
1093
}
1093
1094
1150
1151
overlayLayer . className = 'introjs-overlay' ;
1151
1152
1152
1153
//check if the target element is body, we should calculate the size of overlay layer in a better way
1153
- if ( targetElm . tagName . toLowerCase ( ) === 'body' ) {
1154
+ if ( ! targetElm . tagName || targetElm . tagName . toLowerCase ( ) === 'body' ) {
1154
1155
styleText += 'top: 0;bottom: 0; left: 0;right: 0;position: fixed;' ;
1155
1156
overlayLayer . setAttribute ( 'style' , styleText ) ;
1156
1157
} else {
You can’t perform that action at this time.
0 commit comments