|
410 | 410 | *
|
411 | 411 | * @api private
|
412 | 412 | * @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 |
416 | 417 | */
|
417 | 418 | function _placeTooltip(targetElement, tooltipLayer, arrowLayer, helperNumberLayer) {
|
418 | 419 | var tooltipCssClass = '',
|
419 | 420 | currentStepObj,
|
420 | 421 | tooltipOffset,
|
421 |
| - targetElementOffset; |
| 422 | + targetElementOffset, |
| 423 | + currentTooltipPosition; |
422 | 424 |
|
423 | 425 | //reset the old style
|
424 | 426 | tooltipLayer.style.top = null;
|
|
448 | 450 |
|
449 | 451 | tooltipLayer.className = ('introjs-tooltip ' + tooltipCssClass).replace(/^\s+|\s+$/g, '');
|
450 | 452 |
|
451 |
| - //custom css class for tooltip boxes |
452 |
| - var tooltipCssClass = this._options.tooltipClass; |
453 |
| - |
454 | 453 | currentTooltipPosition = this._introItems[this._currentStep].position;
|
455 | 454 | if ((currentTooltipPosition == "auto" || this._options.tooltipPosition == "auto")) {
|
456 | 455 | if (currentTooltipPosition != "floating") { // Floating is always valid, no point in calculating
|
457 | 456 | currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition)
|
458 | 457 | }
|
459 | 458 | }
|
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(); |
463 | 462 | switch (currentTooltipPosition) {
|
464 | 463 | case 'top':
|
465 | 464 | tooltipLayer.style.left = '15px';
|
|
484 | 483 | if (targetOffset.top + tooltipHeight > windowSize.height) {
|
485 | 484 | // In this case, left would have fallen below the bottom of the screen.
|
486 | 485 | // 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"; |
488 | 487 | arrowLayer.className = 'introjs-arrow right-bottom';
|
489 | 488 | } else {
|
490 | 489 | arrowLayer.className = 'introjs-arrow right';
|
|
0 commit comments