From 45a8cd506bc837af0dc574bedbb89a7e5e9917a9 Mon Sep 17 00:00:00 2001 From: Anis SLIM Date: Thu, 7 Jun 2018 15:59:35 +0200 Subject: [PATCH] Resolution of positioning problem The positioning did not work when positionPopup(step) was called after setting the visibility and display style because the width and height (used in tether) of the popup were equal to 0. --- app/tour-step-service.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/tour-step-service.js b/app/tour-step-service.js index c057023..c29505f 100644 --- a/app/tour-step-service.js +++ b/app/tour-step-service.js @@ -62,14 +62,8 @@ export default function (Tether, $compile, $document, $templateCache, $rootScope * @param step */ function showPopup(step) { - //activate Tether - positionPopup(step); - - //nudge the screen to ensure that Tether is positioned properly - $window.scrollTo($window.scrollX, $window.scrollY + 1); - //wait until next digest - $timeout(() => { + $timeout(function () { //show the popup step.popup.css({ visibility: 'visible', @@ -79,6 +73,8 @@ export default function (Tether, $compile, $document, $templateCache, $rootScope //scroll to popup focusPopup(step); + //activate Tether + positionPopup(step); }, 100); //ensures size and position are correct }