Changeset 261
- Timestamp:
- 05/02/07 14:28:42 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.2/editor/wym.js
r249 r261 495 495 } 496 496 497 if( moz &&newNode) setFocusToNode(newNode);497 if(newNode) setFocusToNode(newNode); 498 498 } 499 499 } … … 1023 1023 1024 1024 //Moxide's patch to re-set the focus on the container 1025 //while calling setContainer() (Gecko only)1025 //while calling setContainer() 1026 1026 //see #21 1027 1027 function setFocusToNode(node) 1028 1028 { 1029 if (ie) { 1030 r=document.body.createTextRange(); 1031 r.moveToElementText(node); 1032 r.collapse(false); 1033 r.move('character',-1); 1034 r.select(); 1035 node.focus(); 1036 } 1037 else if (moz) { 1029 1038 r=document.createRange(); 1030 1039 r.selectNode(node); 1031 1040 sel=iframe().contentWindow.getSelection(); 1032 1041 sel.addRange(r); 1033 sel.collapse(node, 1);1042 sel.collapse(node, node.childNodes.length); 1034 1043 iframe().contentWindow.focus(); 1035 } 1044 } 1045 }
Note: See TracChangeset
for help on using the changeset viewer.