Skip to content

Commit

Permalink
Item14553: broken editor initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Dec 4, 2017
1 parent 5833e18 commit 5669c99
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -19,8 +19,8 @@
/**
* TinyMCE plugin that implements most Foswiki features
*/
(function () {
'use strict';
"use strict";
(function ($) {

// Convert a simple attachment name into a URL
function makeAttachmentURL(url) {
Expand Down Expand Up @@ -173,7 +173,8 @@
// setup handler, and also from the raw->WYSIWYG switch
function switchToWYSIWYG(self, editor) {
// Get the textarea content
var text = editor.getElement().value;
var el = editor.getElement(),
text = el.value;

// When switching back from a raw edit, a show side-effects
// and will re-load the content from the textarea, which contains
Expand Down Expand Up @@ -202,6 +203,7 @@
// (see above for details of why)
editor.initialized = true;
editor.isNotDirty = true;
$(el).trigger("fwSwitchToWYSIWYG", editor);
},
function(type, req, o) {
// Kill the progress state
Expand Down Expand Up @@ -517,4 +519,4 @@

// Register plugin
tinymce.PluginManager.add('foswiki', tinymce.plugins.Foswiki);
})();
})(jQuery);

0 comments on commit 5669c99

Please sign in to comment.