From 8aea7eb14b31d9c7240ce539544bef9337a8b597 Mon Sep 17 00:00:00 2001 From: Tim Down Date: Wed, 17 Aug 2022 01:00:42 +0100 Subject: [PATCH] Rebuild --- lib/rangy-classapplier.js | 2 +- lib/rangy-core.js | 14 +++++++++++++- lib/rangy-highlighter.js | 2 +- lib/rangy-selectionsaverestore.js | 2 +- lib/rangy-serializer.js | 2 +- lib/rangy-textrange.js | 2 +- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/rangy-classapplier.js b/lib/rangy-classapplier.js index 3f014245..c2bb0493 100644 --- a/lib/rangy-classapplier.js +++ b/lib/rangy-classapplier.js @@ -10,7 +10,7 @@ * Copyright 2022, Tim Down * Licensed under the MIT license. * Version: 1.3.1 - * Build date: 16 August 2022 + * Build date: 17 August 2022 */ (function(factory, root) { if (typeof define == "function" && define.amd) { diff --git a/lib/rangy-core.js b/lib/rangy-core.js index e344a805..d9dd3db2 100644 --- a/lib/rangy-core.js +++ b/lib/rangy-core.js @@ -5,7 +5,7 @@ * Copyright 2022, Tim Down * Licensed under the MIT license. * Version: 1.3.1 - * Build date: 16 August 2022 + * Build date: 17 August 2022 */ (function(factory, root) { @@ -3051,6 +3051,11 @@ sel.rangeCount = 0; sel.isCollapsed = true; sel._ranges.length = 0; + updateType(sel); + } + + function updateType(sel) { + sel.type = (sel.rangeCount == 0) ? "None" : (selectionIsCollapsed(sel) ? "Caret" : "Range"); } function getNativeRange(range) { @@ -3100,6 +3105,7 @@ updateAnchorAndFocusFromRange(sel, wrappedRange, false); sel.rangeCount = 1; sel.isCollapsed = wrappedRange.collapsed; + updateType(sel); } function updateControlSelection(sel) { @@ -3124,6 +3130,7 @@ } sel.isCollapsed = sel.rangeCount == 1 && sel._ranges[0].collapsed; updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], false); + updateType(sel); } } } @@ -3193,6 +3200,7 @@ sel.win = sel.anchorNode = sel.focusNode = sel._ranges = null; sel.rangeCount = sel.anchorOffset = sel.focusOffset = 0; sel.detached = true; + updateType(sel); } var cachedRangySelections = []; @@ -3319,6 +3327,7 @@ this._ranges[this.rangeCount - 1] = range; updateAnchorAndFocusFromRange(this, range, selectionIsBackward(this.nativeSelection)); this.isCollapsed = selectionIsCollapsed(this); + updateType(this); } else { // The range was not added successfully. The simplest thing is to refresh this.refresh(); @@ -3387,6 +3396,7 @@ this.rangeCount = 1; this.isCollapsed = this._ranges[0].collapsed; updateAnchorAndFocusFromRange(this, range, false); + updateType(this); } }; @@ -3445,6 +3455,7 @@ } updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], selectionIsBackward(sel.nativeSelection)); sel.isCollapsed = selectionIsCollapsed(sel); + updateType(sel); } else { updateEmptySelection(sel); } @@ -3459,6 +3470,7 @@ sel.rangeCount = 1; updateAnchorAndFocusFromNativeSelection(sel); sel.isCollapsed = selectionIsCollapsed(sel); + updateType(sel); } else { updateEmptySelection(sel); } diff --git a/lib/rangy-highlighter.js b/lib/rangy-highlighter.js index bc399234..9f76b1ad 100644 --- a/lib/rangy-highlighter.js +++ b/lib/rangy-highlighter.js @@ -7,7 +7,7 @@ * Copyright 2022, Tim Down * Licensed under the MIT license. * Version: 1.3.1 - * Build date: 16 August 2022 + * Build date: 17 August 2022 */ (function(factory, root) { if (typeof define == "function" && define.amd) { diff --git a/lib/rangy-selectionsaverestore.js b/lib/rangy-selectionsaverestore.js index 4cf4ad50..db3a4a2e 100644 --- a/lib/rangy-selectionsaverestore.js +++ b/lib/rangy-selectionsaverestore.js @@ -10,7 +10,7 @@ * Copyright 2022, Tim Down * Licensed under the MIT license. * Version: 1.3.1 - * Build date: 16 August 2022 + * Build date: 17 August 2022 */ (function(factory, root) { if (typeof define == "function" && define.amd) { diff --git a/lib/rangy-serializer.js b/lib/rangy-serializer.js index c7a4d648..ec2a9e5c 100644 --- a/lib/rangy-serializer.js +++ b/lib/rangy-serializer.js @@ -11,7 +11,7 @@ * Copyright 2022, Tim Down * Licensed under the MIT license. * Version: 1.3.1 - * Build date: 16 August 2022 + * Build date: 17 August 2022 */ (function(factory, root) { if (typeof define == "function" && define.amd) { diff --git a/lib/rangy-textrange.js b/lib/rangy-textrange.js index c24eed8a..9a7f6793 100644 --- a/lib/rangy-textrange.js +++ b/lib/rangy-textrange.js @@ -27,7 +27,7 @@ * Copyright 2022, Tim Down * Licensed under the MIT license. * Version: 1.3.1 - * Build date: 16 August 2022 + * Build date: 17 August 2022 */ /**