Skip to content

Commit b5005cb

Browse files
committed
clean up some webstorm warnings in _placeTooltip
1 parent bfa87a3 commit b5005cb

File tree

2 files changed

+42
-43
lines changed

2 files changed

+42
-43
lines changed

intro.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -410,15 +410,17 @@
410410
*
411411
* @api private
412412
* @method _placeTooltip
413-
* @param {Object} targetElement
414-
* @param {Object} tooltipLayer
415-
* @param {Object} arrowLayer
413+
* @param {HTMLElement} targetElement
414+
* @param {HTMLElement} tooltipLayer
415+
* @param {HTMLElement} arrowLayer
416+
* @param {HTMLElement} helperNumberLayer
416417
*/
417418
function _placeTooltip(targetElement, tooltipLayer, arrowLayer, helperNumberLayer) {
418419
var tooltipCssClass = '',
419420
currentStepObj,
420421
tooltipOffset,
421-
targetElementOffset;
422+
targetElementOffset,
423+
currentTooltipPosition;
422424

423425
//reset the old style
424426
tooltipLayer.style.top = null;
@@ -448,18 +450,15 @@
448450

449451
tooltipLayer.className = ('introjs-tooltip ' + tooltipCssClass).replace(/^\s+|\s+$/g, '');
450452

451-
//custom css class for tooltip boxes
452-
var tooltipCssClass = this._options.tooltipClass;
453-
454453
currentTooltipPosition = this._introItems[this._currentStep].position;
455454
if ((currentTooltipPosition == "auto" || this._options.tooltipPosition == "auto")) {
456455
if (currentTooltipPosition != "floating") { // Floating is always valid, no point in calculating
457456
currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition)
458457
}
459458
}
460-
var targetOffset = _getOffset(targetElement)
461-
var tooltipHeight = _getOffset(tooltipLayer).height
462-
var windowSize = _getWinSize()
459+
var targetOffset = _getOffset(targetElement);
460+
var tooltipHeight = _getOffset(tooltipLayer).height;
461+
var windowSize = _getWinSize();
463462
switch (currentTooltipPosition) {
464463
case 'top':
465464
tooltipLayer.style.left = '15px';
@@ -484,7 +483,7 @@
484483
if (targetOffset.top + tooltipHeight > windowSize.height) {
485484
// In this case, left would have fallen below the bottom of the screen.
486485
// Modify so that the bottom of the tooltip connects with the target
487-
tooltipLayer.style.top = "-" + (tooltipHeight - targetOffset.height - 20) + "px"
486+
tooltipLayer.style.top = "-" + (tooltipHeight - targetOffset.height - 20) + "px";
488487
arrowLayer.className = 'introjs-arrow right-bottom';
489488
} else {
490489
arrowLayer.className = 'introjs-arrow right';

0 commit comments

Comments
 (0)