Skip to content

Commit

Permalink
stop disabling target element pointer events
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianSipple committed Sep 12, 2018
1 parent 471e3f2 commit 76bba0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
25 changes: 4 additions & 21 deletions addon/services/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,6 @@ export default Service.extend(Evented, {
disableScroll.off(window);
}
if (get(this, 'modal')) {
const tour = get(this, 'tourObject');

if (tour) {
const { steps } = tour;

steps.map((step) => {
const stepElement = getElementForStep(step);

if (step && step.options.attachTo && stepElement) {
stepElement.style.pointerEvents = 'auto';
}
});
}
run('afterRender', () => {
removeElement('#shepherdOverlay');
removeElement('#highlightOverlay');
Expand Down Expand Up @@ -267,14 +254,10 @@ export default Service.extend(Evented, {
currentElement.classList.add(step.options.highlightClass);
}

if (get(this, 'modal')) {
currentElement.style.pointerEvents = 'none';

if (step.options.copyStyles) {
this.createHighlightOverlay(step);
} else {
toggleShepherdModalClass(currentElement);
}
if (step.options.copyStyles) {
this.createHighlightOverlay(step);
} else {
toggleShepherdModalClass(currentElement);
}
},

Expand Down
23 changes: 0 additions & 23 deletions tests/acceptance/ember-shepherd-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,29 +306,6 @@ module('Acceptance | Tour functionality tests', function(hooks) {
assert.ok(buttonActionCalled, 'button action triggered');
});

test('`pointer-events` is set to `auto` for any step element on clean up', async function(assert) {
assert.expect(2);

await visit('/');

await click('.toggleHelpModal');

// Go through a step of the tour...
await click(document.querySelector('[data-id="intro"] .next-button'));

// Get the target element
const targetElement = document.querySelector('.shepherd-target');

// Check the target element has pointer-events = 'none'
assert.equal(targetElement.style.pointerEvents, 'none');

// Exit the tour
await click(document.querySelector('[data-id="installation"] .cancel-button'));

// Check the target element now has pointer-events = 'auto'
assert.equal(targetElement.style.pointerEvents, 'auto');
});

test('scrollTo works with disableScroll on', async function(assert) {
assert.expect(2);
// Setup controller tour settings
Expand Down

0 comments on commit 76bba0d

Please sign in to comment.