aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/text-source-element.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/text-source-element.js')
-rw-r--r--ext/fg/js/text-source-element.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/fg/js/text-source-element.js b/ext/fg/js/text-source-element.js
index a0e1254f..43526060 100644
--- a/ext/fg/js/text-source-element.js
+++ b/ext/fg/js/text-source-element.js
@@ -40,6 +40,10 @@ class TextSourceElement {
return this._endOffset;
}
+ get isConnected() {
+ return this._element.isConnected;
+ }
+
clone() {
return new TextSourceElement(this._element, this._fullContent, this._startOffset, this._endOffset);
}
@@ -73,6 +77,15 @@ class TextSourceElement {
return delta;
}
+ collapse(toStart) {
+ if (toStart) {
+ this._endOffset = this._startOffset;
+ } else {
+ this._startOffset = this._endOffset;
+ }
+ this._content = '';
+ }
+
getRect() {
return this._element.getBoundingClientRect();
}