MDL-24932 Fixed regression caused by the previous commit
authorDavid Mudrak <david.mudrak@gmail.com>
Fri, 29 Oct 2010 22:51:51 +0000 (22:51 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Fri, 29 Oct 2010 22:51:51 +0000 (22:51 +0000)
To reproduce it, I just added a smiley via the popup and inserted some
character directly afterwards. While the smiley img was saved, the text
was not 8-o (it even did not appear in the HTML source view of the
editor before the save).

lib/editor/tinymce/tiny_mce/3.3.9.2/plugins/moodleemoticon/js/dialog.js

index 86359a9..ae504d0 100644 (file)
@@ -3,7 +3,7 @@ var MoodleEmoticonDialog = {
     bookmark : null,
 
     init : function() {
-        this.bookmark = tinyMCEPopup.editor.selection.getBookmark();
+        this.bookmark = tinyMCEPopup.editor.selection.getBookmark(1, true);
 
         // register event handlers for the table rows
         tinymce.each(tinymce.DOM.select('tr.emoticoninfo', document), function(row) {
@@ -36,7 +36,7 @@ var MoodleEmoticonDialog = {
             if (i == index) {
                 tinyMCEPopup.editor.selection.moveToBookmark(this.bookmark);
                 tinyMCEPopup.editor.execCommand('mceInsertContent', false, emoticons[emoticon]);
-                this.bookmark = tinyMCEPopup.editor.selection.getBookmark();
+                this.bookmark = tinyMCEPopup.editor.selection.getBookmark(1, true);
                 tinyMCEPopup.close();
                 return;
             }