Skip to content

Commit 6bc37dd

Browse files
author
Yaron Nachshon
committed
bug fix
1 parent edfe967 commit 6bc37dd

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

intro.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,9 @@
128128
// refactor
129129
function outerPositionElement(element, target, position, offsetX, offsetY){
130130
var offset = convertOuterPositionToOffset(element, target, position);
131-
var temp = element.clone(false, false);
132-
temp.css({left: 0, opacity: 0, zIndex: -1}).appendTo('body');
133-
temp.show();
134-
var width = temp.outerWidth();
135-
element.css({width: width});
136-
137131
offset.left += Number(offsetX || 0);
138132
offset.top += Number(offsetY || 0);
139133
offset = fitOffsetToScreen(offset, element.outerWidth());
140-
element.css({width: ''});
141-
$(temp).remove();
142134
return element.offset(offset);
143135
}
144136

@@ -326,6 +318,8 @@
326318
$(element).removeClass('intro-element-disabled');
327319
$(element).removeClass('intro-element-relative');
328320
$(element).parents('.intro-fixparent').removeClass('intro-fixparent');
321+
// quick hack
322+
$('.intro-fixparent').removeClass('intro-fixparent');
329323
}
330324

331325
function highlightElement(element, interactive){
@@ -377,6 +371,11 @@
377371
if(base.currentStep.element){
378372
unhighlighElement(base.currentStep.element);
379373
}
374+
if(_.isArray(base.currentStep.highlightElements)){
375+
_.each(base.currentStep.highlightElements, function(element){
376+
unhighlighElement(element);
377+
});
378+
}
380379
hint = null;
381380
backdrop = null;
382381
}
@@ -397,19 +396,10 @@
397396
}else{
398397
intro = step.intro;
399398
}
400-
// if(step.dynamicElement){
401-
// if(typeof step.dynamicElementCounter === 'undefined'){
402-
// step.dynamicElementCounter = 0;
403-
// }
404-
// if($(step.element).length - 1 === step.dynamicElementCounter){
405-
// step.dynamicElementCounter = 0;
406-
// }
407-
// selectedElement = $(step.element).eq(step.dynamicElementCounter);
408-
// }
399+
409400
if(step.calculatedElementSelector){
410401
selectedElement = $(step.calculatedElementSelector);
411402
}
412-
console.log('selectedElement: ', selectedElement);
413403
$(selectedElement).get(0).scrollIntoView(false);
414404

415405
hint.setTarget(selectedElement || $('body'));

0 commit comments

Comments
 (0)