dali
unread,May 14, 2013, 5:40:46 AM5/14/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to closure-lib...@googlegroups.com
Hi,
I have a closure editor div which contains nested elements with text nodes. So, whenever a user makes changes, I need to make some changes to the user command *before* applying the changes.
Eg, if user selects a range across div structure and presses an alpha key, I need to
1. change the range delete to only delete text nodes, not the nested elements
2. follow through on the user key press
I'm currently using the handleKeyPress function in a custom plugin.
#1 works like this, but: I don't know how to easily "re-trigger" the alpha key press
Also: I haven't figured out whether there's a "beforeKeyPress" or something I could use instead? I assume then I could just do #1 and let the browser work on #2. This would be ideal - do you have any hints for what could be useful here?
(I've also played with the BEFORECHANGE event, but listening to it directly seems to not recommended for performance, and I didn't find a corresponding "plugin function" such as for the handleKeyXY functions.)