caretPosition: Delete unused var in getPosition()

This commit is contained in:
Richard Hansen 2021-02-22 02:21:02 -05:00 committed by John McLear
parent 02fd0048bf
commit 5e731dfbfd

View file

@ -6,7 +6,7 @@
exports.getPosition = () => {
const range = getSelectionRange();
if (!range || $(range.endContainer).closest('body')[0].id !== 'innerdocbody') return null;
let rect, line;
let line;
// when we have the caret in an empty line, e.g. a line with only a <br>,
// getBoundingClientRect() returns all dimensions value as 0
@ -19,7 +19,6 @@ exports.getPosition = () => {
// when there's a <br> or any element that has no height, we can't get
// the dimension of the element where the caret is
if (!rect || rect.height === 0) {
const clonedRange = createSelectionRange(range);
// as we can't get the element height, we create a text node to get the dimensions
@ -31,7 +30,6 @@ exports.getPosition = () => {
line = getPositionOfElementOrSelection(clonedRange);
clonedRange.detach();
shadowCaret.remove();
}
return line;
};