diff browser_side/richtext.py @ 400:487dd238ab88

browser_side: bug fixes for microblog raw/rich edition toggle
author souliane <souliane@mailoo.org>
date Tue, 11 Mar 2014 13:53:19 +0100
parents 98cd5387d291
children ea03f898067f
line wrap: on
line diff
--- a/browser_side/richtext.py	Tue Mar 11 12:55:31 2014 +0100
+++ b/browser_side/richtext.py	Tue Mar 11 13:53:19 2014 +0100
@@ -312,12 +312,17 @@
         else:
             if not self.initialized:
                 # set the display text in XHTML only during init because a new MicroblogEntry instance is created after each modification
-                text = content['text']
-                if 'title' in content and content['title']:
-                    text = '<h1>%s</h1>%s' % (html_sanitize(content['title']), content['text'])
-                self.display.setContent({'text': text})
+                self.setDisplayContent()
             self.display.edit(False)
 
+    def setDisplayContent(self):
+        """Set the content of the LightTextEditor which is used for display/wysiwyg"""
+        content = self._original_content
+        text = content['text']
+        if 'title' in content and content['title']:
+            text = '<h1>%s</h1>%s' % (html_sanitize(content['title']), content['text'])
+        self.display.setContent({'text': text})
+
     def setFocus(self, focus):
         self.textarea.setFocus(focus)