You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a few questions regarding Monocle. I am new to Javascript so please forgive my newbie questions. Please let me know if these questions should be posted elsewhere.
1 – How can I get the value of lastPageNumber for the current chapter ? A code snippet would be appreciated. It seems it is not exposed through the API, but I could be wrong.
2 – My chapters have images alongside the text. When clicking on an image, a lightbox is displayed so that you can view the image in higher resolution using prettyphoto.
Basically, my img has a onclick function which calls the code to display the lightbox. The problem is of course that this also triggers a page change in Monocle.
I tried using the event from the onclick method and call stopPropagation and preventDefault, but this did not work. I believe the Monocle reader receives the event before my onclick.
Any suggestions?
3 – Similarly, I have an option to select a text quote from the book and email it to a friend. The Select Quote has a Boolean which is true when this mode is on, and false otherwise.
The problem again is that on the mouseup event, The Monocle change page occurs. Is there a way to temporarily turn off the listening of mouse events in the reader (while quotation mode is true) and re-enabling them after?
I have been scratching my head and I have no idea on how to accomplish this. A code snippet if possible would again be appreciated.
Thank you very much,
The text was updated successfully, but these errors were encountered:
If you don't already have a reference to the current component, you can use reader.getPlace().properties.component.
2/3) See Panels — they are described in the README. Marginal or IMode might do the job - otherwise you could roll your own. Also, take a look at the Stencil class. This detects interactions with <a> elements specifically, and passes through onclick events without triggering default click behaviour.
Please re-open if this answer doesn't address your question.
Hi,
I have a few questions regarding Monocle. I am new to Javascript so please forgive my newbie questions. Please let me know if these questions should be posted elsewhere.
1 – How can I get the value of lastPageNumber for the current chapter ? A code snippet would be appreciated. It seems it is not exposed through the API, but I could be wrong.
2 – My chapters have images alongside the text. When clicking on an image, a lightbox is displayed so that you can view the image in higher resolution using prettyphoto.
Basically, my img has a onclick function which calls the code to display the lightbox. The problem is of course that this also triggers a page change in Monocle.
I tried using the event from the onclick method and call stopPropagation and preventDefault, but this did not work. I believe the Monocle reader receives the event before my onclick.
Any suggestions?
3 – Similarly, I have an option to select a text quote from the book and email it to a friend. The Select Quote has a Boolean which is true when this mode is on, and false otherwise.
The problem again is that on the mouseup event, The Monocle change page occurs. Is there a way to temporarily turn off the listening of mouse events in the reader (while quotation mode is true) and re-enabling them after?
I have been scratching my head and I have no idea on how to accomplish this. A code snippet if possible would again be appreciated.
Thank you very much,
The text was updated successfully, but these errors were encountered: