mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 08:27:03 +03:00
Resolve #244
This commit is contained in:
parent
36feca6ce7
commit
01692075c6
1 changed files with 7 additions and 1 deletions
8
dev/External/SquireUI.js
vendored
8
dev/External/SquireUI.js
vendored
|
|
@ -464,12 +464,18 @@ class SquireUI
|
||||||
}
|
}
|
||||||
this.plain.value = cfg.insertBefore ? '\n\n' + signature + '\n\n' + text : text + '\n\n' + signature;
|
this.plain.value = cfg.insertBefore ? '\n\n' + signature + '\n\n' + text : text + '\n\n' + signature;
|
||||||
} else {
|
} else {
|
||||||
const root = this.squire.getRoot(),
|
const squire = this.squire,
|
||||||
|
root = squire.getRoot(),
|
||||||
|
range = squire.getSelection(),
|
||||||
div = createElement('div');
|
div = createElement('div');
|
||||||
div.className = 'rl-signature';
|
div.className = 'rl-signature';
|
||||||
div.innerHTML = cfg.isHtml ? cfg.signature : plainToHtml(cfg.signature);
|
div.innerHTML = cfg.isHtml ? cfg.signature : plainToHtml(cfg.signature);
|
||||||
root.querySelectorAll('div.rl-signature').forEach(node => node.remove());
|
root.querySelectorAll('div.rl-signature').forEach(node => node.remove());
|
||||||
cfg.insertBefore ? root.prepend(div) : root.append(div);
|
cfg.insertBefore ? root.prepend(div) : root.append(div);
|
||||||
|
// Move cursor above signature
|
||||||
|
range.setStart(div, 0);
|
||||||
|
range.setEnd(div, 0);
|
||||||
|
squire.setSelection( range );
|
||||||
}
|
}
|
||||||
this._prev_txt_sig = signature;
|
this._prev_txt_sig = signature;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue