Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Fix blank z-index for value 0 #87

Merged
merged 1 commit into from
May 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/hopscotch.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@
}

// Set z-index and arrow placement
el.style.zIndex = step.zindex || '';
el.style.zIndex = (typeof step.zindex === 'number') ? step.zindex : 'auto';
this._setArrow(step.placement);

// Set bubble positioning
Expand Down
41 changes: 41 additions & 0 deletions test/js/test.hopscotch.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,47 @@ describe('HopscotchBubble', function() {
});
});

describe('z-index', function(){
var bubble;
it('should set z-index if provided', function(){
hopscotch.startTour({
id: 'hopscotch-test-tour',
steps: [ {
target: 'shopping-list',
orientation: 'left',
title: 'Shopping List',
content: 'It\'s a shopping list',
zindex: 100
},
{
target: 'shopping-list',
orientation: 'left',
title: 'Shopping List',
content: 'It\'s a shopping list',
zindex: 0
},
{
target: 'shopping-list',
orientation: 'left',
title: 'Shopping List',
content: 'It\'s a shopping list'
}]
});
bubble = document.querySelector('.hopscotch-bubble');
expect(bubble.style.zIndex).to.be('100');

hopscotch.nextStep();
bubble = document.querySelector('.hopscotch-bubble');
expect(bubble.style.zIndex).to.be('0');

hopscotch.nextStep();
bubble = document.querySelector('.hopscotch-bubble');
expect(bubble.style.zIndex).to.be('auto');

hopscotch.endTour();
});
});

describe('Buttons', function() {
it('should show Skip button when specified', function() {
var $nextBtnEl;
Expand Down