Updated: Comment #10

Problem/Motivation

The tour module does not respond to changes on the page. Here, there's a popup which looks good:
Tour
Yet, when the toolbar is opened or when the sidebar moves from left to right, the layout breaks:
Tour
Tour

Proposed resolution

Added a method to refresh the position of the tour and trigger the refresh once the viewport offsets change.

Remaining tasks

Decide how to fix, see #18

User interface changes

- The popup's position should change according to the events that trigger changes in the layout.

API changes

Issue fork drupal-2224541

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sqndr’s picture

Priority: Normal » Minor
wwwalker’s picture

Issue tags: +#views #tour

The bug occurs when the menu is changed from horizontal to vertical orientation by clicking on the 'vertical orientation' button on the top right of the browser. But the error does not occur when the menu is changed by resizing the browser, i.e. menu does not overlap the tip box and tip points to the right HTML tag. If the menu is changed from vertical to horizontal by clicking 'horizontal orientation' button, the tip box is pointing to the wrong position and is not following tag until the browser is resized when it points to right tag again. It seems that a side effect of tour.js (Backbone) is not updating its tip position until browser is resized.

paulh’s picture

Possibly a solution is to position the Tours from the corner of the page element, not the corner of the body.

Sam152’s picture

Status: Needs work » Needs review
FileSize
908 bytes

Added a method to refresh the position of the tour and trigger the refresh once the viewport offsets change.

fenstrat’s picture

Status: Needs review » Needs work

Good work @Sam152. The $tour.joyride('is_phone') seems odd, but it is how joyride does it. Tested and this fixes the issue nicely.

Just a minor nitpick:

+++ b/core/modules/tour/js/tour.js
@@ -118,6 +119,19 @@
+      else{

Missing space between else and {

Sam152’s picture

Thanks for the feedback fenstrat. Fix attached.

I think it's pretty annoying that joyride doesn't provide a method that abstracts this tidbit away. I had considered triggering resize.joyride, but it seemed hackier than the minor duplication.

er.pushpinderrana’s picture

Status: Needs work » Needs review
FileSize
909 bytes

Rerolled patch.

Status: Needs review » Needs work

The last submitted patch, 7: 2224541-7-tour-module-respond-changes.patch, failed testing.

Status: Needs work » Needs review
fenstrat’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This is good to go. There hasn't been any movement on #2027623: De-fork jQuery Joyride and update to latest stable release (and at a glance it looks like joyride 2.1 will not fix this). This patch fixes a real bug we have, so this is RTBC.

alexpott’s picture

Issue tags: -#views #tour +JavaScript

Tagging for a JS maintainer review.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

This patch makes the JS crash with the error Uncaught TypeError: Cannot read property 'width' of undefined some things are not initialized properly in joyride in those conditions. Putting a if ($tour.length) {} helps on most pages but still breaks other pages. The new refreshPosition method needs to check if a tour is open before doing anything.

The event needs to be namespaced, bind it to drupalViewportOffsetChange.joyride please.

Sam152’s picture

Thanks for the review nod_. Binding to ".joyride" causes the fix to only work once, as joyride destroys all of the events when you close it for the first time, causing subsequent reopens to break. Instead I've namespaced to "tour". Also fixed the inactivty by using the 'isActive' flag.

Sam152’s picture

Status: Needs work » Needs review
nod_’s picture

can you go with this.refreshPosition.bind(this) ? don't need underscore to do that it's native.

Sam152’s picture

Saw that pattern a few other places in core. It saves us from having to go var _this = this; function() { _this.refreshPosition.bind(_this) }, so it is a fair bit more concise.

Sam152’s picture

Misunderstood #16, cleared up on IRC. New patch attached.

nod_’s picture

Status: Needs review » Needs work

The position when playing around with the toolbar isn't really perfect. Maybe a timing thing. When you have a tip pointing at an element opening and closing the menu tray makes the tip point to something irrelevant.

Not sure how to fix.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -JavaScript +JavaScript, +Bug Smash Initiative

This is reproducible on Drupal 9.5.x. The patch does not apply so I was not able to test it. It could be re-rolled but then

Not sure how to fix.

from @nod_ in #18

So, it seems the next step is to determine how to fix this or possibly close as works as designed. Setting the status to NR for discussion.

finnsky’s picture

Version: 9.4.x-dev » 9.5.x-dev

andypost’s picture

Manibharathi E R’s picture

#33 Patch Tested and Applied successfully on Drupal 9.5.x.

Steps to Reproduce:
1. Install using standard install profile
2. Enable the Tour module
3. Go to structure->views->Edit the Content View
4. Start the Tour
5. Change the Toolbar orientation Vertical.
6. Apply the Patch and check the UI.

DishaKatariya’s picture

Assigned: Unassigned » DishaKatariya
DishaKatariya’s picture

Assigned: DishaKatariya » Unassigned
Status: Needs review » Reviewed & tested by the community
FileSize
107.18 KB
114.24 KB

Verified and tested patch #33 applied successfully and looks good to me on Dupal 9.5.x version
Testing steps-
1. Install the module
2. Enable the Tour module
3. Go to structure->views->Edit the Content View
4. Start the Tour
5. Change the Toolbar orientation Vertical.
6. Apply the Patch and check the UI.
7. Check the tooltip/popup is getting cropped

Testing results-
The popup is appearing fine now and not getting cropped

Attaching the screenshot for reference:
Can be moved to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

We'll need a D10 version of the patch as there are no .es6 files there and JS standards have changed because we don't support IE.

Also can we add a test for this in \Drupal\Tests\tour\FunctionalJavascript\TourJavascriptTest::testGeneralTourUse() or maybe a new Nightwatch test?

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Postponed

This extension is being deprecated, see #3336033: [Meta] Tasks to deprecate Tour module. It will be removed from core and moved to a contrib project, #3376099: [11.x] [Meta] Tasks to remove Tour.

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.