Credit goes to Jan Sindberg for the idea published at
http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=59653#p59653
var MoodleEmoticonDialog = {
+ bookmark : null,
+
init : function() {
+ this.bookmark = tinyMCEPopup.editor.selection.getBookmark();
+
// register event handlers for the table rows
tinymce.each(tinymce.DOM.select('tr.emoticoninfo', document), function(row) {
i = 0;
for (var emoticon in emoticons) {
if (i == index) {
+ tinyMCEPopup.editor.selection.moveToBookmark(this.bookmark);
tinyMCEPopup.editor.execCommand('mceInsertContent', false, emoticons[emoticon]);
+ this.bookmark = tinyMCEPopup.editor.selection.getBookmark();
tinyMCEPopup.close();
return;
}