-
Notifications
You must be signed in to change notification settings - Fork 533
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
Store plugin: how to send variable values in annotationData #714
Comments
Have you tried adding an eventListener for this purpose and get a value of window.innerWidth save it to a var and then pass that value to the annotationData? |
Well, like I said, I don't know jQuery, and although I've tried, I haven't succeeded. You are saying that like it's not a convoluted process (which I believe; I just haven't been able to deduce some working code on my own). Would you mind showing an example snippet that does what you're suggesting? |
Again, it would be helpful if you would include a snippet to illustrate what you're suggesting. |
@zahqresh Really, can you elaborate even a bit on what you're suggesting? |
Hi, sorry have been busy i'll look at the issue again and get back for more you cant send me an email and we can work on this if you want thank :) |
@zahqresh Hi; any elaboration here? |
Let me start by saying this is very likely to be a jQuery issue, but for the life of me I'm turning up blanks on any answers that're real-world applicable. I've gone back through the entire mailing list archive (via the Wayback Machine...).
I have a deployment where I'm wanting to add some fields to the annotationData, but in which the values may change from annotation to annotation. And I'm not seeing how to set that up in a jQuery script for the annotator. What I need to capture is a straightforward bit of DOM info, but the setup for the Store plugin (apparently) gets evaluated on page load and doesn't see the updates. This is on 1.2, because touch support is a prerequisite.
Here's a minimal, but accurate, example. In thy page:
All I'm after here is to get the window.innerWidth, if it gets changed, but in my tests I get the initial value (correctly) on the first annotation, but changing the window size doesn't result in an updated value being sent with subsequent annotations. The storage backend is getting whatever is sent, so that's not the issue. It's the page.
Is there some easy answer I haven't found?
Like I said, I don't do jQuery stuff normally, and searching for examples just hasn't led anywhere at all; whether that's because search engines don't index stuff like
$
in a way that leads to good results or there is something out-of-the-ordinary about the the sample code from the Annotator docs, I don't have any way to know.The text was updated successfully, but these errors were encountered: