joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

Monocle 3.2.0 and text selection using onMouseUpEvent at <iframe class="monelem_component" .... > #238

Closed EduCepas closed 10 years ago

EduCepas commented 10 years ago

Hi everyone,

I have a highlighting algorithm based on the "onMouseUpEvent" inside the body of the of the iframe monelem_component.

I have updated to the last version of monocle 3.2.0 from 2.3.1, and since that moment, the event doesn't happen, so the highlither doesn't work anymore. What is more, the pointer doesn't change from the "arrow" to "text selection vertical bar" when focusing on that div "monelem_sheaf" / iframe "monelem_component".

I have no idea why, or if it has to do with the new event handler Gala and if I should perform any specific change....

I need some help with that, any idea or suggestion will be appreciated.

Thanks a lot in advance,

joseph commented 10 years ago

What panel are you using? It sounds to me like you're using the default two-pane panel, but hoping for the behavior of the marginal or magic panel. In general for Monocle > 3 I recommend the magic panel.

http://test.monoclejs.com/test/panels/index.html

I don't know of any onMouseUpEvent in the browser or certainly in Monocle, and for cross-pointer compat I recommend you use Gala's onContact instead. Or, if you are using native browser selection, Monocle.Selection is by far the easiest way to do this:

http://test.monoclejs.com/test/selection/index.html