Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Tour: name of link doesn't get displayed #1190

Closed
Mr-Kanister opened this issue Dec 22, 2023 · 8 comments
Closed

Virtual Tour: name of link doesn't get displayed #1190

Mr-Kanister opened this issue Dec 22, 2023 · 8 comments
Labels
Milestone

Comments

@Mr-Kanister
Copy link

Mr-Kanister commented Dec 22, 2023

Describe the bug

Hi there,
the name attribute of a link should override the tooltip of the link. Unfortunately it is not doing that.

See the demo URL: The tooltip of the link to the third node should be "This doesn't get displayed" instead of "Three". The standard name doesn't get overwritten though.

Thanks for your brilliant work!

Online demo URL

https://jsfiddle.net/30crw6ep/2/

Photo Sphere Viewer version

5.5.1

Plugins loaded

virtual-tour-plugin

OS & browser

Debian 12, Firefox 115.5.0esr

Additional context

No response

@mistic100
Copy link
Owner

mistic100 commented Jan 1, 2024

This is also the case for gps, the original intend was not to allow overring values but provide them synchronously before loading the linked node data.

I admit the documentation is misleading.

I there a real use case for overriding the node name for a specific link ?

I am considering removing link.name entirely, only keeping link.gps which is required in server mode.

@Mr-Kanister
Copy link
Author

For me there certainly is a use case: on a staircase, I would like the link to say "Up" when coming from downstairs, but "Down" when coming from upstairs. However, the node itself might be called "Staircase", for example.

@mistic100 mistic100 added this to the 5.5.2 milestone Jan 1, 2024
@mistic100
Copy link
Owner

mistic100 commented Jan 1, 2024

So because the tooltip can also contain the node thumbnail and the caption if they are defined I removed link.name anyway.

But I added a new option to customize the tooltip at will.


getLinkTooltip(content, link, node)

  • type: function(string, link, node) => string
  • default: null
  • updatable: no

Callback used to replace/modify the tooltip for a link. The first parameter is the default tooltip content which contains the node name + thumbnail + caption.


Remember that the links have a data property where you can store any useful data

getLinkTooltip(content, link) {
  return link.data.myTooltip;
}

@Mr-Kanister
Copy link
Author

Thanks, I will look into it.

Copy link

github-actions bot commented Jan 3, 2024

This feature/bug fix has been released in version 5.5.2.

@Mr-Kanister
Copy link
Author

Alright, I tried it and it does work. But the style of the tooltip is completely off. Am I using it wrong?

See this demo: https://jsfiddle.net/u9ox1bLq/2/

The tooltip on the link to the third node does get changed but it has no background, the arrow is in the middle of the text and the overflow is cursed.

@mistic100
Copy link
Owner

That's because of this https://github.com/mistic100/Photo-Sphere-Viewer/blob/main/packages/virtual-tour-plugin/src/style.scss#L14

I will try to fix that.

In the meantime wrap you custom tooltip in a <p> tag

@Mr-Kanister
Copy link
Author

I see. Thank you very much for your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants