Mouseover and other JS events?

760 views
Skip to first unread message

Sawyer Hollenshead

unread,
Jun 2, 2013, 12:55:44 PM6/2/13
to ace-d...@googlegroups.com
I couldn't find any info on how Ace handles JS events, but I have a Markdown editor and am trying to attach mouseover events to links (which have the ace_underline class). I've tried doing the following:

$(document).on("mouseover", ".ace_underline", function()...

However the event doesn't seem to fire and I'm wondering if there's something happening with the Ace editor that is first capturing that event and preventing it? Any ideas?

Harutyun Amirjanyan

unread,
Jun 3, 2013, 5:05:13 AM6/3/13
to ace-d...@googlegroups.com
ace uses pointer-events:none

you can try
.ace_markup.ace_underline {
pointer-events: auto
}


or use
editor.on("mousemove", function(e) {
var pos = e.getDocumentPosition()
var token = e.editor.session.getTokenAt(pos.row, pos.column)
if (token && token.type == "markup.underline") {
console.log(token)
}
})

see https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/token_tooltip.js
for an example
Reply all
Reply to author
Forward
0 new messages