mirror of https://github.com/keeweb/keeweb.git
ct: Try to preserve newlines while copying.
- For some reason, copying a multi-line field's value in Chrome does so whilst preserving newlines. In the desktop app on OSX, though, multiline values are copied as a single line. - Although non-standard, the .innerText property of a Node will do better at preserving plain-text-formatting (newlines, and such) from child elements. Where it doesn't exist, fallback to whatever JQuery's `.text()` uses.
This commit is contained in:
parent
8990058bca
commit
7f19d90514
|
@ -85,7 +85,7 @@ var FieldView = Backbone.View.extend({
|
|||
range.selectNodeContents(this.valueEl[0]);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
copyRes = CopyPaste.copy(this.valueEl.text());
|
||||
copyRes = CopyPaste.copy(this.valueEl[0].innerText || this.valueEl.text());
|
||||
if (copyRes) {
|
||||
selection.removeAllRanges();
|
||||
this.trigger('copy', { source: this, copyRes: copyRes });
|
||||
|
|
Loading…
Reference in New Issue