|
83 | 83 |
|
84 | 84 | if (this._options.steps) {
|
85 | 85 | //use steps passed programmatically
|
86 |
| - var allIntroSteps = []; |
87 |
| - |
88 | 86 | for (var i = 0, stepsLength = this._options.steps.length; i < stepsLength; i++) {
|
89 | 87 | var currentItem = _cloneObject(this._options.steps[i]);
|
90 | 88 | //set the step
|
|
265 | 263 | */
|
266 | 264 | function _cloneObject(object) {
|
267 | 265 | if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {
|
268 |
| - return object; |
| 266 | + return object; |
269 | 267 | }
|
270 | 268 | var temp = {};
|
271 | 269 | for (var key in object) {
|
| 270 | + if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) { |
| 271 | + temp[key] = object[key]; |
| 272 | + } else { |
272 | 273 | temp[key] = _cloneObject(object[key]);
|
| 274 | + } |
273 | 275 | }
|
274 | 276 | return temp;
|
275 | 277 | }
|
|
374 | 376 | var referenceLayer = targetElement.querySelector('.introjs-tooltipReferenceLayer');
|
375 | 377 | if (referenceLayer) {
|
376 | 378 | referenceLayer.parentNode.removeChild(referenceLayer);
|
377 |
| - } |
| 379 | + } |
378 | 380 | //remove disableInteractionLayer
|
379 | 381 | var disableInteractionLayer = targetElement.querySelector('.introjs-disableInteraction');
|
380 | 382 | if (disableInteractionLayer) {
|
|
398 | 400 | if (fixParents && fixParents.length > 0) {
|
399 | 401 | for (var i = fixParents.length - 1; i >= 0; i--) {
|
400 | 402 | fixParents[i].className = fixParents[i].className.replace(/introjs-fixParent/g, '').replace(/^\s+|\s+$/g, '');
|
401 |
| - }; |
| 403 | + } |
402 | 404 | }
|
403 | 405 |
|
404 | 406 | //clean listeners
|
|
461 | 463 | currentTooltipPosition = this._introItems[this._currentStep].position;
|
462 | 464 | if ((currentTooltipPosition == "auto" || this._options.tooltipPosition == "auto")) {
|
463 | 465 | if (currentTooltipPosition != "floating") { // Floating is always valid, no point in calculating
|
464 |
| - currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition) |
| 466 | + currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition); |
465 | 467 | }
|
466 | 468 | }
|
467 | 469 | targetOffset = _getOffset(targetElement);
|
|
481 | 483 | // In this case, right would have fallen below the bottom of the screen.
|
482 | 484 | // Modify so that the bottom of the tooltip connects with the target
|
483 | 485 | arrowLayer.className = "introjs-arrow left-bottom";
|
484 |
| - tooltipLayer.style.top = "-" + (tooltipOffset.height - targetOffset.height - 20) + "px" |
| 486 | + tooltipLayer.style.top = "-" + (tooltipOffset.height - targetOffset.height - 20) + "px"; |
485 | 487 | } else {
|
486 | 488 | arrowLayer.className = 'introjs-arrow left';
|
487 | 489 | }
|
|
501 | 503 | }
|
502 | 504 | tooltipLayer.style.right = (targetOffset.width + 20) + 'px';
|
503 | 505 |
|
504 |
| - |
505 | 506 | break;
|
506 | 507 | case 'floating':
|
507 | 508 | arrowLayer.style.display = 'none';
|
|
593 | 594 | function _determineAutoPosition(targetElement, tooltipLayer, desiredTooltipPosition) {
|
594 | 595 |
|
595 | 596 | // Take a clone of position precedence. These will be the available
|
596 |
| - var possiblePositions = this._options.positionPrecedence.slice() |
| 597 | + var possiblePositions = this._options.positionPrecedence.slice(); |
597 | 598 |
|
598 |
| - var windowSize = _getWinSize() |
599 |
| - var tooltipHeight = _getOffset(tooltipLayer).height + 10 |
600 |
| - var tooltipWidth = _getOffset(tooltipLayer).width + 20 |
601 |
| - var targetOffset = _getOffset(targetElement) |
| 599 | + var windowSize = _getWinSize(); |
| 600 | + var tooltipHeight = _getOffset(tooltipLayer).height + 10; |
| 601 | + var tooltipWidth = _getOffset(tooltipLayer).width + 20; |
| 602 | + var targetOffset = _getOffset(targetElement); |
602 | 603 |
|
603 | 604 | // If we check all the possible areas, and there are no valid places for the tooltip, the element
|
604 | 605 | // must take up most of the screen real estate. Show the tooltip floating in the middle of the screen.
|
605 |
| - var calculatedPosition = "floating" |
| 606 | + var calculatedPosition = "floating"; |
606 | 607 |
|
607 | 608 | // Check if the width of the tooltip + the starting point would spill off the right side of the screen
|
608 | 609 | // If no, neither bottom or top are valid
|
609 | 610 | if (targetOffset.left + tooltipWidth > windowSize.width || ((targetOffset.left + (targetOffset.width / 2)) - tooltipWidth) < 0) {
|
610 |
| - _removeEntry(possiblePositions, "bottom") |
| 611 | + _removeEntry(possiblePositions, "bottom"); |
611 | 612 | _removeEntry(possiblePositions, "top");
|
612 | 613 | } else {
|
613 | 614 | // Check for space below
|
614 | 615 | if ((targetOffset.height + targetOffset.top + tooltipHeight) > windowSize.height) {
|
615 |
| - _removeEntry(possiblePositions, "bottom") |
| 616 | + _removeEntry(possiblePositions, "bottom"); |
616 | 617 | }
|
617 | 618 |
|
618 | 619 | // Check for space above
|
|
639 | 640 | // If the requested position is in the list, replace our calculated choice with that
|
640 | 641 | if (desiredTooltipPosition && desiredTooltipPosition != "auto") {
|
641 | 642 | if (possiblePositions.indexOf(desiredTooltipPosition) > -1) {
|
642 |
| - calculatedPosition = desiredTooltipPosition |
| 643 | + calculatedPosition = desiredTooltipPosition; |
643 | 644 | }
|
644 | 645 | }
|
645 | 646 |
|
646 |
| - return calculatedPosition |
| 647 | + return calculatedPosition; |
647 | 648 | }
|
648 | 649 |
|
649 | 650 | /**
|
|
838 | 839 | bulletsLayer.style.display = 'none';
|
839 | 840 | }
|
840 | 841 |
|
841 |
| - |
842 | 842 | var ulContainer = document.createElement('ul');
|
843 | 843 |
|
844 | 844 | for (var i = 0, stepsLength = this._introItems.length; i < stepsLength; i++) {
|
|
995 | 995 | var zIndex = _getPropValue(parentElm, 'z-index');
|
996 | 996 | var opacity = parseFloat(_getPropValue(parentElm, 'opacity'));
|
997 | 997 | var transform = _getPropValue(parentElm, 'transform') || _getPropValue(parentElm, '-webkit-transform') || _getPropValue(parentElm, '-moz-transform') || _getPropValue(parentElm, '-ms-transform') || _getPropValue(parentElm, '-o-transform');
|
998 |
| - if (/[0-9]+/.test(zIndex) || opacity < 1 || transform !== 'none') { |
| 998 | + if (/[0-9]+/.test(zIndex) || opacity < 1 || (transform !== 'none' && transform !== undefined)) { |
999 | 999 | parentElm.className += ' introjs-fixParent';
|
1000 | 1000 | }
|
1001 | 1001 |
|
|
0 commit comments