Skip to content

Commit 8219e11

Browse files
author
Yaron Nachshon
committed
modal and hide step
1 parent eddf1af commit 8219e11

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

intro.js

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
var currentStepIndex;
1010
var hint;
1111
var backdrop;
12+
var modal;
1213
// Access to jQuery and DOM versions of element
1314

1415
base.init = function(){
@@ -134,6 +135,11 @@
134135
return element.offset(offset);
135136
}
136137

138+
function Modal(){
139+
var that = this;
140+
141+
}
142+
137143

138144
function Hint(){
139145
var tooltip;
@@ -384,6 +390,7 @@
384390
return (typeof value) === 'function';
385391
}
386392

393+
387394
function showStep(step){
388395
var _showStep = function(){
389396
var selectedElement;
@@ -402,10 +409,13 @@
402409
}
403410
$(selectedElement).get(0).scrollIntoView(false);
404411

405-
hint.setTarget(selectedElement || $('body'));
406-
hint.setPosition(step.hintPosition);
407-
hint.setTooltipPosition(step.tooltipPosition);
408-
hint.setContent(intro);
412+
if(!step.modal){
413+
hint.setTarget(selectedElement || $('body'));
414+
hint.setPosition(step.hintPosition);
415+
hint.setTooltipPosition(step.tooltipPosition);
416+
hint.setContent(intro);
417+
}
418+
409419

410420
highlightElement(selectedElement, base.options.highlightInteractivity);
411421

@@ -414,7 +424,15 @@
414424
highlightElement(element, base.options.highlightInteractivity);
415425
});
416426
}
417-
return hint.render();
427+
428+
429+
430+
if(!step.modal){
431+
return hint.render();
432+
}else{
433+
434+
return jQuery.when();
435+
}
418436
};
419437

420438
var beforeShowCallback = step.onBeforeShow || base.options.onBeforeShow;
@@ -464,6 +482,10 @@
464482
currentStepIndex = 0;
465483
};
466484

485+
base.hideStep = function(){
486+
hideStep(base.currentStep);
487+
};
488+
467489
// Run initializer
468490
base.init();
469491
};

0 commit comments

Comments
 (0)