Luke Plant avatar Luke Plant committed 17bd2e5

Fixed bug with semantic editor

Comments (0)

Files changed (1)

semanticeditor/media/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

     // Other event handlers added in update_optsbox
 };
 
+PresentationControls.prototype.set_html = function(html) {
+    // WUMEditor ought to call .listen() after setting
+    // the HTML (to rebind events for images),
+    // but it doesn't at the moment, so we work around it by wrapping.
+    self.wym.html(html);
+    self.wym.listen();
+};
+
 // Splits the HTML into 'content HTML' and 'presentation'
 PresentationControls.prototype.separate_presentation = function() {
     var self = this;
 			    // Store the presentation
 			    self.presentation_info = value.presentation;
 			    // Update the HTML
-			    self.wym.html(value.html);
+                            self.set_html(value.html);
 			});
 		}, "json");
 };
     var data = JSON.parse(res);
     if (data.result == 'ok') {
 	// Replace existing HTML with combined.
-	this.wym.html(data.value.html);
+        this.set_html(data.value.html);
 	// In case the normal WYMeditor update got called *before* this
 	// event handler, we do another update.
 	this.wym.update();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.