File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 184
184
var tooltipPosition ;
185
185
var hintPosition ;
186
186
var wasRendered = false ;
187
+ var model = {
188
+ visibility : true
189
+ } ;
187
190
188
191
function getTooltipArrowElement ( ) {
189
192
return tooltip . find ( '.intro-tooltip-arrow' ) ;
291
294
trackElementChange ( targetElement , 1000 ) ;
292
295
} ;
293
296
297
+ this . setVisiblity = function ( isVisible ) {
298
+ model . visibility = isVisible ;
299
+ } ;
300
+
294
301
this . setPosition = function ( position ) {
295
302
hintPosition = position ;
296
303
} ;
310
317
tooltip . remove ( ) ;
311
318
} ;
312
319
313
- this . isVisible = function ( ) {
320
+ this . isTooltipVisible = function ( ) {
314
321
return Number ( $ ( tooltip ) . css ( 'opacity' ) ) > 0 ;
315
322
} ;
316
323
323
330
getTooltipArrowElement ( ) . attr ( 'position' , tooltipPosition ) ;
324
331
repositionTooltip ( ) ;
325
332
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 ( ) ) {
327
339
tooltip . css ( 'opacity' , 0 ) . show ( ) ;
328
340
tooltip . animate ( { 'opacity' : 1 } ) ;
329
341
} else {
455
467
if ( step . calculatedElementSelector ) {
456
468
selectedElement = $ ( step . calculatedElementSelector ) ;
457
469
}
470
+
458
471
$ ( selectedElement ) . get ( 0 ) . scrollIntoView ( false ) ;
459
472
460
473
if ( ! step . modal ) {
461
474
hint . setTarget ( selectedElement || $ ( 'body' ) ) ;
462
475
hint . setPosition ( step . hintPosition ) ;
463
476
hint . setTooltipPosition ( step . tooltipPosition ) ;
477
+ hint . setVisiblity ( step . showHint ) ;
464
478
hint . setContent ( intro ) ;
465
479
}
466
480
475
489
476
490
if ( step . backdrop ) {
477
491
backdrop . show ( ) ;
492
+ backdrop . css ( {
493
+ opacity : step . backdropOpacity
494
+ } ) ;
478
495
} else {
479
496
backdrop . hide ( ) ;
480
497
}
Original file line number Diff line number Diff line change @@ -157,3 +157,7 @@ $intro-backdrop-z-index: $intro-element-z-index - 100;
157
157
top : 50% ;
158
158
z-index : $intro-backdrop-z-index + 100 ;
159
159
}
160
+
161
+ .intro-hidden {
162
+ visibility : hidden ;
163
+ }
You can’t perform that action at this time.
0 commit comments