- 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
release-0.6
alecpl 16 years ago
parent 876b15dcce
commit 910d07e300

@ -2060,24 +2060,30 @@ function rcube_webmail()
{ {
var editor = tinyMCE.get('compose-body'); 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 sigElem = editor.dom.get("_rc_sig");
var newsig = '';
var htmlsig = true;
if (!sigElem) if (!sigElem)
{ {
sigElem = editor.getDoc().createElement("span"); sigElem = editor.getDoc().createElement("div");
sigElem.setAttribute("id", "_rc_sig"); sigElem.setAttribute("id", "_rc_sig");
editor.getBody().appendChild(sigElem); editor.getBody().appendChild(sigElem);
} }
if (this.env.signatures[id]['is_html'])
{ if (this.env.signatures[id])
sigElem.innerHTML = this.env.signatures[id]['text']; {
} newsig = this.env.signatures[id]['text'];
htmlsig = this.env.signatures[id]['is_html'];
}
if (htmlsig)
sigElem.innerHTML = newsig;
else else
{ sigElem.innerHTML = '<pre>' + newsig + '</pre>';
sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>';
}
} }
} }

Loading…
Cancel
Save