@samuelbradshaw/highlight-helper-js 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/highlight-helper.js +18 -18
  2. package/package.json +1 -1
@@ -969,25 +969,25 @@ function Highlighter(options = hhDefaultOptions) {
969
969
  && ((options.showCustomSelectionHandlesForActiveHighlights && activeHighlightId)
970
970
  || (options.showCustomSelectionHandlesForTextSelection && !activeHighlightId))
971
971
  ) {
972
- setCustomSelectionHandleVisibility(true);
973
- }
974
- for (const selectionHandle of selectionHandles) {
975
- let side;
976
- if (selectionHandle.dataset.position === 'start') {
977
- side = startNodeIsRtl ? 'right' : 'left';
978
- selectionHandle.style.left = startRect[side] - relativeAncestorClientRect.left + 'px';
979
- selectionHandle.style.height = startRect.height + 'px';
980
- selectionHandle.style.top = startRect.top - relativeAncestorClientRect.top + 'px';
981
- } else {
982
- side = endNodeIsRtl ? 'left' : 'right';
983
- selectionHandle.style.left = endRect[side] - relativeAncestorClientRect.left + 'px';
984
- selectionHandle.style.height = endRect.height + 'px';
985
- selectionHandle.style.top = endRect.top - relativeAncestorClientRect.top + 'px';
986
- }
987
- if (selectionHandle.dataset.side !== side) {
988
- selectionHandle.dataset.side = side;
989
- this.setOption('selectionHandles', options.selectionHandles);
972
+ for (const selectionHandle of selectionHandles) {
973
+ let side;
974
+ if (selectionHandle.dataset.position === 'start') {
975
+ side = startNodeIsRtl ? 'right' : 'left';
976
+ selectionHandle.style.left = startRect[side] - relativeAncestorClientRect.left + 'px';
977
+ selectionHandle.style.height = startRect.height + 'px';
978
+ selectionHandle.style.top = startRect.top - relativeAncestorClientRect.top + 'px';
979
+ } else {
980
+ side = endNodeIsRtl ? 'left' : 'right';
981
+ selectionHandle.style.left = endRect[side] - relativeAncestorClientRect.left + 'px';
982
+ selectionHandle.style.height = endRect.height + 'px';
983
+ selectionHandle.style.top = endRect.top - relativeAncestorClientRect.top + 'px';
984
+ }
985
+ if (selectionHandle.dataset.side !== side) {
986
+ selectionHandle.dataset.side = side;
987
+ this.setOption('selectionHandles', options.selectionHandles);
988
+ }
990
989
  }
990
+ setCustomSelectionHandleVisibility(true);
991
991
  }
992
992
  } else {
993
993
  setCustomSelectionHandleVisibility(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samuelbradshaw/highlight-helper-js",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "JavaScript tool that enables highlighting or underlining text in an HTML page.",
5
5
  "type": "module",
6
6
  "main": "highlight-helper.mjs",