Angularjs hijack click event?

jtanz
Posts: 28
Joined: Mon Mar 27, 2017 11:24 pm

Re: Angularjs hijack click event?

Postby jtanz » Mon May 01, 2017 2:58 pm

So in the web browser the hotspot.onClick.add works well, but when viewing in mobile, it does not work correctly.
After clicking a hotspot with the additional .onClick.add method, the next hotspot you click will trigger the same function even though it does not have any additional click functions added to it.

Example : Click on hotspot A, displays modal window. Click on hotspot B, opens up hotspots A modal window. Click on hotspot B again, then it correctly goes to the next scene.

Code: Select all

    forgeHotspot.onClick.add(function (onClickEvent){
      var hotspotId = onClickEvent.emitter.uid;
      //Do something
    });

User avatar
aberthet
ForgeJS Team
Posts: 10
Joined: Tue Dec 13, 2016 2:53 pm

Re: Angularjs hijack click event?

Postby aberthet » Tue May 02, 2017 8:42 am

It is indeed a bug, I can reproduce it with the latest build. I filled an issue about it, hopefully we will resolve it with the Raycasting problem (the need to click twice problem).

User avatar
rroux
ForgeJS Team
Posts: 108
Joined: Wed Oct 26, 2016 12:19 pm

Re: Angularjs hijack click event?

Postby rroux » Wed May 03, 2017 8:51 am

Hi jtanz,

Just to clarify the onReady event of the FORGE.Viewer

It fires when all the module are created (like story, plugin manager etc ...). It does not notify that your config is loaded.
In fact the loading of your config happens after the onReady event.

What we could do is to add a onConfigLoaded kind of event on the FORGE.Viewer

And you can't access an hotspot through FORGE.UID.get("hotspot-uid") before it was created, so you have to wait to be on a loaded scene with the hotspot you need already created :)

have a nice day!
- Raphaël

Who is online

Users browsing this forum: No registered users and 2 guests