41 | | var oRange = new FCKDomRange( FCK.EditorWindow ) ; |
42 | | oRange.MoveToSelection() ; |
43 | | var oEditorScrollPos = FCKTools.GetScrollPosition( FCK.EditorWindow ) ; |
| 41 | var oRange, oEditorScrollPos ; |
| 42 | if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) |
| 43 | { |
| 44 | oRange = new FCKDomRange( FCK.EditorWindow ) ; |
| 45 | oRange.MoveToSelection() ; |
| 46 | oEditorScrollPos = FCKTools.GetScrollPosition( FCK.EditorWindow ) ; |
| 47 | } |
| 48 | else |
| 49 | { |
| 50 | var eTextarea = FCK.EditingArea.Textarea ; |
| 51 | oRange = !FCKBrowserInfo.IsIE && [ eTextarea.selectionStart, eTextarea.selectionEnd ] ; |
| 52 | oEditorScrollPos = [ eTextarea.scrollLeft, eTextarea.scrollTop ] ; |
| 53 | } |
170 | | oRange.Select() ; |
171 | | FCK.EditorWindow.scrollTo( oEditorScrollPos.X, oEditorScrollPos.Y ) ; |
| 180 | if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) |
| 181 | { |
| 182 | oRange.Select() ; |
| 183 | FCK.EditorWindow.scrollTo( oEditorScrollPos.X, oEditorScrollPos.Y ) ; |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | if ( !FCKBrowserInfo.IsIE ) |
| 188 | { |
| 189 | eTextarea.selectionStart = oRange[0] ; |
| 190 | eTextarea.selectionEnd = oRange[1] ; |
| 191 | } |
| 192 | eTextarea.scrollLeft = oEditorScrollPos[0] ; |
| 193 | eTextarea.scrollTop = oEditorScrollPos[1] ; |
| 194 | } |