|
158 | 158 | if (currentEl.getAttribute('data-step') === null) { |
159 | 159 |
|
160 | 160 | while (true) { |
161 | | - if (typeof introItems[nextStep] == 'undefined') { |
| 161 | + if (typeof introItems[nextStep] === 'undefined') { |
162 | 162 | break; |
163 | 163 | } |
164 | 164 | else { |
|
251 | 251 | } |
252 | 252 | }; |
253 | 253 |
|
254 | | - self._onResize = function(e) { |
| 254 | + self._onResize = function() { |
255 | 255 | _setHelperLayerPosition.call(self, document.querySelector('.introjs-helperLayer')); |
256 | 256 | _setHelperLayerPosition.call(self, document.querySelector('.introjs-tooltipReferenceLayer')); |
257 | 257 | }; |
|
302 | 302 | } |
303 | 303 | var temp = {}; |
304 | 304 | for (var key in object) { |
305 | | - if (typeof(jQuery) != 'undefined' && object[key] instanceof jQuery) { |
| 305 | + if (typeof(jQuery) !== 'undefined' && object[key] instanceof jQuery) { |
306 | 306 | temp[key] = object[key]; |
307 | 307 | } |
308 | 308 | else { |
|
486 | 486 | } |
487 | 487 |
|
488 | 488 | //prevent error when `this._currentStep` is undefined |
489 | | - if (!this._introItems[this._currentStep]) return; |
| 489 | + if (!this._introItems[this._currentStep]) { |
| 490 | + return; |
| 491 | + } |
490 | 492 |
|
491 | 493 | //if we have a custom css class for each step |
492 | 494 | currentStepObj = this._introItems[this._currentStep]; |
|
500 | 502 | tooltipLayer.className = ('introjs-tooltip ' + tooltipCssClass).replace(/^\s+|\s+$/g, ''); |
501 | 503 |
|
502 | 504 | currentTooltipPosition = this._introItems[this._currentStep].position; |
503 | | - if ((currentTooltipPosition == "auto" || this._options.tooltipPosition == "auto")) { |
504 | | - if (currentTooltipPosition != "floating") { // Floating is always valid, no point in calculating |
| 505 | + if ((currentTooltipPosition === "auto" || this._options.tooltipPosition === "auto")) { |
| 506 | + if (currentTooltipPosition !== "floating") { // Floating is always valid, no point in calculating |
505 | 507 | currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition); |
506 | 508 | } |
507 | 509 | } |
|
688 | 690 | } |
689 | 691 |
|
690 | 692 | // If the requested position is in the list, replace our calculated choice with that |
691 | | - if (desiredTooltipPosition && desiredTooltipPosition != "auto") { |
| 693 | + if (desiredTooltipPosition && desiredTooltipPosition !== "auto") { |
692 | 694 | if (possiblePositions.indexOf(desiredTooltipPosition) > -1) { |
693 | 695 | calculatedPosition = desiredTooltipPosition; |
694 | 696 | } |
|
725 | 727 | elementPosition = _getOffset(currentElement.element), |
726 | 728 | widthHeightPadding = 10; |
727 | 729 |
|
728 | | - if (currentElement.position == 'floating') { |
| 730 | + if (currentElement.position === 'floating') { |
729 | 731 | widthHeightPadding = 0; |
730 | 732 | } |
731 | 733 |
|
|
846 | 848 |
|
847 | 849 | //show the tooltip |
848 | 850 | oldtooltipContainer.style.opacity = 1; |
849 | | - if (oldHelperNumberLayer) oldHelperNumberLayer.style.opacity = 1; |
| 851 | + if (oldHelperNumberLayer) { |
| 852 | + oldHelperNumberLayer.style.opacity = 1; |
| 853 | + } |
850 | 854 |
|
851 | 855 | //reset button focus |
852 | 856 | if (self._options.showSkipButton && nextTooltipButton.tabIndex === -1) { |
|
902 | 906 | self.goToStep(this.getAttribute('data-stepnumber')); |
903 | 907 | }; // jshint ignore:line |
904 | 908 |
|
905 | | - if (l === (targetElement.step - 1)) anchorLink.className = 'active'; |
| 909 | + if (l === (targetElement.step - 1)) { |
| 910 | + anchorLink.className = 'active'; |
| 911 | + } |
906 | 912 |
|
907 | 913 | anchorLink.href = 'javascript:void(0);'; // jshint ignore:line |
908 | 914 | anchorLink.innerHTML = " "; |
|
950 | 956 | nextTooltipButton = document.createElement('a'); |
951 | 957 |
|
952 | 958 | nextTooltipButton.onclick = function() { |
953 | | - if (!self._options.showSkipButton && self._introItems.length - 1 == self._currentStep && typeof(self._introCompleteCallback) === 'function') { |
| 959 | + if (!self._options.showSkipButton && self._introItems.length - 1 === self._currentStep && typeof(self._introCompleteCallback) === 'function') { |
954 | 960 | self._introCompleteCallback.call(self); |
955 | 961 | } |
956 | | - if (!self._options.showSkipButton && self._introItems.length - 1 != self._currentStep && typeof(self._introExitCallback) === 'function') { |
| 962 | + if (!self._options.showSkipButton && self._introItems.length - 1 !== self._currentStep && typeof(self._introExitCallback) === 'function') { |
957 | 963 | self._introExitCallback.call(self); |
958 | 964 | } |
959 | 965 | if (self._introItems.length - 1 != self._currentStep) { |
|
992 | 998 | skipTooltipButton.innerHTML = this._options.skipLabel; |
993 | 999 |
|
994 | 1000 | skipTooltipButton.onclick = function() { |
995 | | - if (self._introItems.length - 1 == self._currentStep && typeof(self._introCompleteCallback) === 'function') { |
| 1001 | + if (self._introItems.length - 1 === self._currentStep && typeof(self._introCompleteCallback) === 'function') { |
996 | 1002 | self._introCompleteCallback.call(self); |
997 | 1003 | } |
998 | 1004 |
|
999 | | - if (self._introItems.length - 1 != self._currentStep && typeof(self._introExitCallback) === 'function') { |
| 1005 | + if (self._introItems.length - 1 !== self._currentStep && typeof(self._introExitCallback) === 'function') { |
1000 | 1006 | self._introExitCallback.call(self); |
1001 | 1007 | } |
1002 | 1008 |
|
|
1036 | 1042 | nextTooltipButton.innerHTML = this._options.nextLabel; |
1037 | 1043 | } |
1038 | 1044 | } |
1039 | | - else if (this._introItems.length - 1 == this._currentStep || this._introItems.length == 1) { |
| 1045 | + else if (this._introItems.length - 1 === this._currentStep || this._introItems.length === 1) { |
1040 | 1046 | if (this._options.showSkipButton) { |
1041 | 1047 | skipTooltipButton.innerHTML = this._options.doneLabel; |
1042 | 1048 | nextTooltipButton.className = 'introjs-button introjs-nextbutton introjs-disabled'; |
|
1074 | 1080 |
|
1075 | 1081 | var parentElm = targetElement.element.parentNode; |
1076 | 1082 | while (parentElm !== null) { |
1077 | | - if (parentElm.tagName.toLowerCase() === 'body') break; |
| 1083 | + if (parentElm.tagName.toLowerCase() === 'body') { |
| 1084 | + break; |
| 1085 | + } |
1078 | 1086 |
|
1079 | 1087 | //fix The Stacking Contenxt problem. |
1080 | 1088 | //More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context |
|
1340 | 1348 | break; |
1341 | 1349 | case 'touchend': |
1342 | 1350 | event_handle.touches[event.type] = true; |
1343 | | - if (!event_handle.touches.touchmove.entered) |
| 1351 | + if (!event_handle.touches.touchmove.entered) { |
1344 | 1352 | break; |
| 1353 | + } |
1345 | 1354 | event_handle._y_diff = event_handle.touches.touchstart.y > event_handle.touches.touchmove.y ? event_handle.touches.touchstart.y - event_handle.touches.touchmove.y : event_handle.touches.touchmove.y - event_handle.touches.touchstart.y; |
1346 | 1355 | event_handle._x_diff = event_handle.touches.touchstart.x > event_handle.touches.touchmove.x ? event_handle.touches.touchstart.x - event_handle.touches.touchmove.x : event_handle.touches.touchmove.x - event_handle.touches.touchstart.x; |
1347 | 1356 | if (event_handle.touches.touchstart.x > -1 && event_handle.touches.touchmove.x > -1 && event_handle._x_diff > event_handle._x_min_length && event_handle._x_diff >= event_handle._y_diff) { |
|
0 commit comments