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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user