From 76bba0ddd5de94fe09ef6eba50749f42a4dbc538 Mon Sep 17 00:00:00 2001 From: Brian Sipple Date: Tue, 11 Sep 2018 23:19:22 -0700 Subject: [PATCH] stop disabling target element pointer events --- addon/services/tour.js | 25 ++++--------------------- tests/acceptance/ember-shepherd-test.js | 23 ----------------------- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/addon/services/tour.js b/addon/services/tour.js index 1ba448f3..59df725a 100644 --- a/addon/services/tour.js +++ b/addon/services/tour.js @@ -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'); @@ -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); } }, diff --git a/tests/acceptance/ember-shepherd-test.js b/tests/acceptance/ember-shepherd-test.js index ddef213b..beb41064 100644 --- a/tests/acceptance/ember-shepherd-test.js +++ b/tests/acceptance/ember-shepherd-test.js @@ -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