Skip to content

Commit

Permalink
style: format source
Browse files Browse the repository at this point in the history
  • Loading branch information
markocikos committed Nov 10, 2022
1 parent fcb2910 commit 6ac5ab6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/selections/selection-position.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ const centerToolbar = function(toolbar, rect) {

if (ranges && ranges.length === 1) {
let startContainer = ranges[0].startContainer;
let nodeName = startContainer.$.nodeName;

if (startContainer.$.nodeType !== Node.ELEMENT_NODE) {
startContainer = startContainer.getParent();
}

const nodeName = startContainer.$.nodeName;

if (nodeName === 'TD' || nodeName === 'TH') {
const startContainerClientRect = startContainer.getClientRect();
offsetHeight = startContainerClientRect.y - rect.top;
Expand Down

0 comments on commit 6ac5ab6

Please sign in to comment.