Compare commits

..

1 Commits

Author SHA1 Message Date
Kevin Jahns
86dc602a8d v13.0.0-63 -- distribution files 2018-06-23 00:31:01 +02:00
7 changed files with 29 additions and 19 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "yjs", "name": "yjs",
"version": "13.0.0-65", "version": "13.0.0-63",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "yjs", "name": "yjs",
"version": "13.0.0-65", "version": "13.0.0-63",
"description": "A framework for real-time p2p shared editing on any data", "description": "A framework for real-time p2p shared editing on any data",
"main": "./y.node.js", "main": "./y.node.js",
"browser": "./y.js", "browser": "./y.js",

View File

@@ -140,6 +140,7 @@ export default class DomBinding extends Binding {
restoreSelection (selection) { restoreSelection (selection) {
if (selection !== null) { if (selection !== null) {
const { to, from } = selection const { to, from } = selection
let shouldUpdate = false
/** /**
* There is little information on the difference between anchor/focus and base/extent. * There is little information on the difference between anchor/focus and base/extent.
* MDN doesn't even mention base/extent anymore.. though you still have to call * MDN doesn't even mention base/extent anymore.. though you still have to call
@@ -158,6 +159,7 @@ export default class DomBinding extends Binding {
if (node !== baseNode || offset !== baseOffset) { if (node !== baseNode || offset !== baseOffset) {
baseNode = node baseNode = node
baseOffset = offset baseOffset = offset
shouldUpdate = true
} }
} }
} }
@@ -169,15 +171,18 @@ export default class DomBinding extends Binding {
if (node !== extentNode || offset !== extentOffset) { if (node !== extentNode || offset !== extentOffset) {
extentNode = node extentNode = node
extentOffset = offset extentOffset = offset
shouldUpdate = true
} }
} }
} }
browserSelection.setBaseAndExtent( if (shouldUpdate) {
baseNode, browserSelection.setBaseAndExtent(
baseOffset, baseNode,
extentNode, baseOffset,
extentOffset extentNode,
) extentOffset
)
}
} }
} }

4
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
/** /**
* yjs - A framework for real-time p2p shared editing on any data * yjs - A framework for real-time p2p shared editing on any data
* @version v13.0.0-65 * @version v13.0.0-63
* @license MIT * @license MIT
*/ */
@@ -5645,6 +5645,7 @@ class DomBinding extends Binding {
restoreSelection (selection) { restoreSelection (selection) {
if (selection !== null) { if (selection !== null) {
const { to, from } = selection; const { to, from } = selection;
let shouldUpdate = false;
/** /**
* There is little information on the difference between anchor/focus and base/extent. * There is little information on the difference between anchor/focus and base/extent.
* MDN doesn't even mention base/extent anymore.. though you still have to call * MDN doesn't even mention base/extent anymore.. though you still have to call
@@ -5663,6 +5664,7 @@ class DomBinding extends Binding {
if (node !== baseNode || offset !== baseOffset) { if (node !== baseNode || offset !== baseOffset) {
baseNode = node; baseNode = node;
baseOffset = offset; baseOffset = offset;
shouldUpdate = true;
} }
} }
} }
@@ -5674,15 +5676,18 @@ class DomBinding extends Binding {
if (node !== extentNode || offset !== extentOffset) { if (node !== extentNode || offset !== extentOffset) {
extentNode = node; extentNode = node;
extentOffset = offset; extentOffset = offset;
shouldUpdate = true;
} }
} }
} }
browserSelection.setBaseAndExtent( if (shouldUpdate) {
baseNode, browserSelection.setBaseAndExtent(
baseOffset, baseNode,
extentNode, baseOffset,
extentOffset extentNode,
); extentOffset
);
}
} }
} }

File diff suppressed because one or more lines are too long