From 910d07e3002a9077500e09abea968fc7f2eaeb91 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 29 Aug 2008 02:44:09 -0400
Subject: [PATCH] - signature in html editor must be in <div> not <span>, because   IE not allows to include block elements inside <span> - if identity has no signature, replace previous with empty div

---
 program/js/app.js |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index bfab003..0e5aa01 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2060,24 +2060,30 @@
       {
       var editor = tinyMCE.get('compose-body');
 
-      if (this.env.signatures && this.env.signatures[id])
+      if (this.env.signatures)
         {
-        // Append the signature as a span within the body
+        // Append the signature as a div within the body
         var sigElem = editor.dom.get("_rc_sig");
+	var newsig = '';
+	var htmlsig = true;
+	
         if (!sigElem)
           {
-          sigElem = editor.getDoc().createElement("span");
+          sigElem = editor.getDoc().createElement("div");
           sigElem.setAttribute("id", "_rc_sig");
           editor.getBody().appendChild(sigElem);
           }
-        if (this.env.signatures[id]['is_html'])
-          {
-          sigElem.innerHTML = this.env.signatures[id]['text'];
-          }
+
+	if (this.env.signatures[id])
+	  {
+	  newsig = this.env.signatures[id]['text'];
+	  htmlsig = this.env.signatures[id]['is_html'];
+	  }
+
+        if (htmlsig)
+          sigElem.innerHTML = newsig;
         else
-          {
-          sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>';
-          }
+          sigElem.innerHTML = '<pre>' + newsig + '</pre>';
         }
       }
 

--
Gitblit v1.9.1