mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Fix signature adding
This commit is contained in:
parent
b8e0303fc4
commit
6b1fd1239f
3 changed files with 37 additions and 14 deletions
|
|
@ -58,10 +58,23 @@ class HtmlEditor
|
|||
return this.editor ? 'wysiwyg' === this.editor.mode : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
clearCachedSignature() {
|
||||
if (this.editor)
|
||||
{
|
||||
this.editor.execCommand('insertSignature', {
|
||||
clearCache: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} signature
|
||||
* @param {bool} html
|
||||
* @param {bool} insertBefore
|
||||
* @returns {void}
|
||||
*/
|
||||
setSignature(signature, html, insertBefore) {
|
||||
if (this.editor)
|
||||
|
|
@ -163,6 +176,8 @@ class HtmlEditor
|
|||
setHtml(html, focus) {
|
||||
if (this.editor && this.__inited)
|
||||
{
|
||||
this.clearCachedSignature();
|
||||
|
||||
this.modeToggle(true);
|
||||
|
||||
html = html.replace(/<p[^>]*><\/p>/ig, '');
|
||||
|
|
@ -193,6 +208,8 @@ class HtmlEditor
|
|||
setPlain(plain, focus) {
|
||||
if (this.editor && this.__inited)
|
||||
{
|
||||
this.clearCachedSignature();
|
||||
|
||||
this.modeToggle(false);
|
||||
if ('plain' === this.editor.mode && this.editor.plugins.plain && this.editor.__plain)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue