Compare commits

..

4 Commits

Author SHA1 Message Date
Kevin Jahns
240cf64841 v13.0.0-65 -- distribution files 2018-07-16 18:38:27 +02:00
Kevin Jahns
548125a944 13.0.0-65 2018-07-16 18:38:09 +02:00
Kevin Jahns
a7b124ca6e 13.0.0-64 2018-07-16 18:19:36 +02:00
Kevin Jahns
4022374620 dombinding: always set browser range after change 2018-07-16 18:15:24 +02:00
7 changed files with 19 additions and 29 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@@ -140,7 +140,6 @@ export default class DomBinding extends Binding {
restoreSelection (selection) {
if (selection !== null) {
const { to, from } = selection
let shouldUpdate = false
/**
* 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
@@ -159,7 +158,6 @@ export default class DomBinding extends Binding {
if (node !== baseNode || offset !== baseOffset) {
baseNode = node
baseOffset = offset
shouldUpdate = true
}
}
}
@@ -171,18 +169,15 @@ export default class DomBinding extends Binding {
if (node !== extentNode || offset !== extentOffset) {
extentNode = node
extentOffset = offset
shouldUpdate = true
}
}
}
if (shouldUpdate) {
browserSelection.setBaseAndExtent(
baseNode,
baseOffset,
extentNode,
extentOffset
)
}
browserSelection.setBaseAndExtent(
baseNode,
baseOffset,
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
* @version v13.0.0-63
* @version v13.0.0-65
* @license MIT
*/
@@ -5645,7 +5645,6 @@ class DomBinding extends Binding {
restoreSelection (selection) {
if (selection !== null) {
const { to, from } = selection;
let shouldUpdate = false;
/**
* 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
@@ -5664,7 +5663,6 @@ class DomBinding extends Binding {
if (node !== baseNode || offset !== baseOffset) {
baseNode = node;
baseOffset = offset;
shouldUpdate = true;
}
}
}
@@ -5676,18 +5674,15 @@ class DomBinding extends Binding {
if (node !== extentNode || offset !== extentOffset) {
extentNode = node;
extentOffset = offset;
shouldUpdate = true;
}
}
}
if (shouldUpdate) {
browserSelection.setBaseAndExtent(
baseNode,
baseOffset,
extentNode,
extentOffset
);
}
browserSelection.setBaseAndExtent(
baseNode,
baseOffset,
extentNode,
extentOffset
);
}
}

File diff suppressed because one or more lines are too long