Ticket #21 (closed enhancement: fixed)
Item focus is lost when switching container
| Reported by: | Moxide | Owned by: | jf.hovinne |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.2 |
| Component: | editor | Version: | trunk |
| Keywords: | Cc: |
Description
Reference : http://forum.wymeditor.org/forum/viewtopic.php?t=80 In Mozilla, when switching a container, focus is lost, so you must click on the container to give the focus back to it.
This piece of (hacky) code might do the trick :
function setFocusToNode(node) {
if (moz) {
r=document.createRange();
r.selectNode(node);
sel=iframe().contentWindow.getSelection();
sel.addRange(r);
sel.collapse(node,0);
iframe().contentWindow.focus();
}
}
Attached is a modified 'wym.js' file, implementing the function above (for WYMeditor 0.2.2), in case someone wants to see this function in action.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.