From 434989de080ab9ddb2e5ac1c84577237596a0d34 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 21 Feb 2021 16:47:03 +0000 Subject: [PATCH] always true/false variables --- src/static/js/AttributeManager.js | 2 +- src/static/js/caretPosition.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index 1d8bd9376..bac6cfa91 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -212,7 +212,7 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({ let hasAttrib = true; // from selStart to the end of the first line - hasAttrib = hasAttrib && rangeHasAttrib( + hasAttrib = rangeHasAttrib( selStart, [selStart[0], rep.lines.atIndex(selStart[0]).text.length]); // for all lines in between diff --git a/src/static/js/caretPosition.js b/src/static/js/caretPosition.js index 32f6d919b..a217765da 100644 --- a/src/static/js/caretPosition.js +++ b/src/static/js/caretPosition.js @@ -21,7 +21,7 @@ exports.getPosition = () => { // when there's a
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) { + if (rect.height === 0) { const clonedRange = createSelectionRange(range); // as we can't get the element height, we create a text node to get the dimensions