Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -384,10 +384,10 @@ |
385 | 385 | //surround by <p> if it does not already have it |
386 | 386 | var t = context.fn.getOffset(); |
387 | 387 | if ( t.node.parentNode.nodeName.toLowerCase() == 'body' ) { |
388 | | - var cursorPos = context.fn.getCaretPosition()[0]; |
| 388 | + var cursorPos = context.fn.getCaretPosition(); |
389 | 389 | $( t.node ).wrap( "<p></p>" ); |
390 | | - context.fn.refreshOffsets(); |
391 | | - context.fn.setSelection( { start: cursorPos, end: cursorPos } ); |
| 390 | + context.fn.purgeOffsets(); |
| 391 | + context.fn.setSelection( { start: cursorPos[0], end: cursorPos[1] } ); |
392 | 392 | } |
393 | 393 | |
394 | 394 | |