MDL-24932 way around for bloody IE8 loosing caret position in moodleemoticon

Credit goes to Jan Sindberg for the idea published at
http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=59653#p59653
This commit is contained in:
David Mudrak
2010-10-29 22:01:07 +00:00
parent 9d16a85707
commit d504aeba97
@@ -1,6 +1,10 @@
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) {
@@ -30,7 +34,9 @@ var MoodleEmoticonDialog = {
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;
}