pchen66 / panolens.js

Javascript panorama viewer based on Three.js
https://pchen66.github.io/Panolens/
MIT License
2.79k stars 498 forks source link

Separate hoverStart and hoverEnd from show/hide element #411

Open JoseManuelFV opened 1 year ago

JoseManuelFV commented 1 year ago

I added 3 feactures:

  1. Separate the onHoverStart and onHoverEnd from the hover element, because it was called from the onClick and onDismiss respectively, and I believe that the events should be worked separately, not that one should call the other one. For this feature I have created: · showElement: the name says it all · hideElement: the name says it all

  2. On the other hand, I have also added a feature, which has been requested by several people, which is to separate the hoverElement from the hover and show it only when onClick.
    For this feature I have created: · addClickElement: Same as addElement. But it automatically configures only the clickable element · addElement: Refactoring of the old addHoverElement method · removeElement: Refactoring of the old removeHoverElement method · addClickText: Same as addTextElement. But it automatically configures only the clickable element · addTextElement: Refactoring of the old addHoverText method · showHoverElement: Configuration for only clicable element

  3. I have added deprecated for: · removeHoverElement: Same as removeElement · addHoverElement: Same as removeElement · addHoverText: Same as addTextElement


    The posts that mention/ask for this feature: Feacture 1: https://github.com/pchen66/panolens.js/issues/333 https://github.com/pchen66/panolens.js/issues/268 Feacture 2: https://github.com/pchen66/panolens.js/issues/394 https://github.com/pchen66/panolens.js/issues/272

lgtm-com[bot] commented 1 year ago

This pull request introduces 1 alert when merging 913b423e8ccddc81957606a454842b57183bb6bb into 562ff9d732d7872fa54eb7fb011ba0788f8bc104 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 1 year ago

This pull request introduces 1 alert when merging 295ef60c4a1a9f84118285e30b84ad6a1bad2ce7 into 562ff9d732d7872fa54eb7fb011ba0788f8bc104 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 1 year ago

This pull request introduces 1 alert when merging 1fbe8da3cfa2d35ad8f212174af0e96fa06a5616 into 562ff9d732d7872fa54eb7fb011ba0788f8bc104 - view on LGTM.com

new alerts: