mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
caretPosition: Delete unused var in getPosition()
This commit is contained in:
parent
02fd0048bf
commit
5e731dfbfd
1 changed files with 10 additions and 12 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue