Skip to content

Commit 08f729c

Browse files
author
Yaron Nachshon
committed
bug fixes
1 parent 0d5b1eb commit 08f729c

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

intro.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@
184184
var tooltipPosition;
185185
var hintPosition;
186186
var wasRendered = false;
187+
var model = {
188+
visibility : true
189+
};
187190

188191
function getTooltipArrowElement(){
189192
return tooltip.find('.intro-tooltip-arrow');
@@ -291,6 +294,10 @@
291294
trackElementChange(targetElement, 1000);
292295
};
293296

297+
this.setVisiblity = function(isVisible){
298+
model.visibility = isVisible;
299+
};
300+
294301
this.setPosition = function(position){
295302
hintPosition = position;
296303
};
@@ -310,7 +317,7 @@
310317
tooltip.remove();
311318
};
312319

313-
this.isVisible = function(){
320+
this.isTooltipVisible = function(){
314321
return Number($(tooltip).css('opacity')) > 0;
315322
};
316323

@@ -323,7 +330,12 @@
323330
getTooltipArrowElement().attr('position', tooltipPosition);
324331
repositionTooltip();
325332

326-
if(!that.isVisible()){
333+
if(model.visibility){
334+
that.element.removeClass('intro-hidden');
335+
}else{
336+
that.element.addClass('intro-hidden');
337+
}
338+
if(!that.isTooltipVisible()){
327339
tooltip.css('opacity', 0).show();
328340
tooltip.animate({'opacity': 1});
329341
}else{
@@ -455,12 +467,14 @@
455467
if(step.calculatedElementSelector){
456468
selectedElement = $(step.calculatedElementSelector);
457469
}
470+
458471
$(selectedElement).get(0).scrollIntoView(false);
459472

460473
if(!step.modal){
461474
hint.setTarget(selectedElement || $('body'));
462475
hint.setPosition(step.hintPosition);
463476
hint.setTooltipPosition(step.tooltipPosition);
477+
hint.setVisiblity(step.showHint);
464478
hint.setContent(intro);
465479
}
466480

@@ -475,6 +489,9 @@
475489

476490
if(step.backdrop){
477491
backdrop.show();
492+
backdrop.css({
493+
opacity: step.backdropOpacity
494+
});
478495
}else{
479496
backdrop.hide();
480497
}

introjs.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

introjs.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,7 @@ $intro-backdrop-z-index: $intro-element-z-index - 100;
157157
top: 50%;
158158
z-index: $intro-backdrop-z-index + 100;
159159
}
160+
161+
.intro-hidden{
162+
visibility: hidden;
163+
}

0 commit comments

Comments
 (0)