@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.
- package/highlight-helper.js +18 -18
- package/package.json +1 -1
package/highlight-helper.js
CHANGED
|
@@ -969,25 +969,25 @@ function Highlighter(options = hhDefaultOptions) {
|
|
|
969
969
|
&& ((options.showCustomSelectionHandlesForActiveHighlights && activeHighlightId)
|
|
970
970
|
|| (options.showCustomSelectionHandlesForTextSelection && !activeHighlightId))
|
|
971
971
|
) {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
selectionHandle.
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
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