mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 05:00:13 -05:00
parent
25ff83455e
commit
cbde7a9198
3 changed files with 11 additions and 7 deletions
|
@ -2118,16 +2118,18 @@ var onCopy = function ( event ) {
|
||||||
var range = this.getSelection();
|
var range = this.getSelection();
|
||||||
var node = this.createElement( 'div' );
|
var node = this.createElement( 'div' );
|
||||||
var root = this._root;
|
var root = this._root;
|
||||||
var contents, parent, newContents;
|
var startBlock, contents, parent, newContents;
|
||||||
|
|
||||||
// Edge only seems to support setting plain text as of 2016-03-11.
|
// Edge only seems to support setting plain text as of 2016-03-11.
|
||||||
// Mobile Safari flat out doesn't work:
|
// Mobile Safari flat out doesn't work:
|
||||||
// https://bugs.webkit.org/show_bug.cgi?id=143776
|
// https://bugs.webkit.org/show_bug.cgi?id=143776
|
||||||
if ( !isEdge && !isIOS && clipboardData ) {
|
if ( !isEdge && !isIOS && clipboardData ) {
|
||||||
range = range.cloneRange();
|
range = range.cloneRange();
|
||||||
if ( getStartBlockOfRange( range, root ) ===
|
startBlock = getStartBlockOfRange( range, root );
|
||||||
getEndBlockOfRange( range, root ) ) {
|
if ( startBlock === getEndBlockOfRange( range, root ) ) {
|
||||||
|
// Copy all inline formatting, but that's it.
|
||||||
moveRangeBoundariesDownTree( range );
|
moveRangeBoundariesDownTree( range );
|
||||||
|
moveRangeBoundariesUpTree( range, startBlock );
|
||||||
contents = range.cloneContents();
|
contents = range.cloneContents();
|
||||||
} else {
|
} else {
|
||||||
moveRangeBoundariesUpTree( range, root );
|
moveRangeBoundariesUpTree( range, root );
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -39,16 +39,18 @@ var onCopy = function ( event ) {
|
||||||
var range = this.getSelection();
|
var range = this.getSelection();
|
||||||
var node = this.createElement( 'div' );
|
var node = this.createElement( 'div' );
|
||||||
var root = this._root;
|
var root = this._root;
|
||||||
var contents, parent, newContents;
|
var startBlock, contents, parent, newContents;
|
||||||
|
|
||||||
// Edge only seems to support setting plain text as of 2016-03-11.
|
// Edge only seems to support setting plain text as of 2016-03-11.
|
||||||
// Mobile Safari flat out doesn't work:
|
// Mobile Safari flat out doesn't work:
|
||||||
// https://bugs.webkit.org/show_bug.cgi?id=143776
|
// https://bugs.webkit.org/show_bug.cgi?id=143776
|
||||||
if ( !isEdge && !isIOS && clipboardData ) {
|
if ( !isEdge && !isIOS && clipboardData ) {
|
||||||
range = range.cloneRange();
|
range = range.cloneRange();
|
||||||
if ( getStartBlockOfRange( range, root ) ===
|
startBlock = getStartBlockOfRange( range, root );
|
||||||
getEndBlockOfRange( range, root ) ) {
|
if ( startBlock === getEndBlockOfRange( range, root ) ) {
|
||||||
|
// Copy all inline formatting, but that's it.
|
||||||
moveRangeBoundariesDownTree( range );
|
moveRangeBoundariesDownTree( range );
|
||||||
|
moveRangeBoundariesUpTree( range, startBlock );
|
||||||
contents = range.cloneContents();
|
contents = range.cloneContents();
|
||||||
} else {
|
} else {
|
||||||
moveRangeBoundariesUpTree( range, root );
|
moveRangeBoundariesUpTree( range, root );
|
||||||
|
|
Loading…
Reference in a new issue