Does the API recognize events on multiple DOM elements #28

Open
ppcano opened this Issue Feb 28, 2012 · 5 comments

Comments

Projects
None yet
2 participants

ppcano commented Feb 28, 2012

Hi, i am wondering how the API works.

I would like to have in the webpage multiple elements which respond individually to the gesture recognition.

Is that possible with the current version, or on the other hand, the API fires the specific events globally.

Thanks and congratulations for the job.

Collaborator

royshil commented Feb 28, 2012

@ppcano
The events fire globally and you can create handlers to work with them.
I believe you can have multiple handlers for the same event.

Roy.

ppcano commented Feb 28, 2012

@royshil, did you test/plan/discuss during project development, if it could be possible to fire events on individual DOM elements depending if the event was initiated on the visual render area of the specific html element.

$element1.bind("DepthJSEvent", function() {});

$element2.bind("DepthJSEvent", function() {});

On this case, the event should only be fired to the specific element, if the event was initiated at the element rendered area.

I guess, that is not a trivial problem, but that fits perfect for my purpose, and any feedback would be really appreciated.

lg

Collaborator

royshil commented Mar 4, 2012

@ppcano In fact the "link clicking" capability of the gestual browser application (the standard application for DepthJS) is doing something very similar - looking for lins that are under the blue marker.
You can rewrite that functionality and get what you need...
I encourage you to write a small application that does that and push it back to this repo as an example application.

ppcano commented Mar 5, 2012

@royshil, please, could you please point me where the project is located? Now, i have no time to implement anything, so just wanted to take a look and value the required efforts , but i hope i/we write the proof-of-concept app you mentioned.

Collaborator

royshil commented Mar 5, 2012

@ppcano You can see how the "link clicking" is implemented here:
https://github.com/doug/depthjs/blob/master/extension-common/content_script/selector_box.js
Look at the DepthJS.selectorBox.activate function, see how it looks for elements under the selector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment