Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bkd705 committed Jul 26, 2024
1 parent f2e3363 commit e57cd6a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions apps/mocksi-lite/content/EditMode/editMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ function onMouseUp(event: MouseEvent) {

removeMultiSelectionDecoration();

if (!range || !selection || (range.startContainer === range.endContainer && range.startOffset === range.endOffset)) {
console.log('skipping because no selection');
if (
!range ||
!selection ||
(range.startContainer === range.endContainer &&
range.startOffset === range.endOffset)
) {
console.log("skipping because no selection");
return;
}

Expand Down Expand Up @@ -243,7 +248,7 @@ const createEditTextButton = (
const buttonWidth = 75;
const buttonHeight = 24;

const xPos = ((coords.left + coords.right) / 2) - (buttonWidth / 2);
const xPos = (coords.left + coords.right) / 2 - buttonWidth / 2;
const yPos = coords.top - buttonHeight - 8;

button.id = "mocksiMultiSelectEditButton";
Expand All @@ -254,13 +259,13 @@ const createEditTextButton = (
left: `${xPos}px`,
zIndex: "999",
backgroundColor: "white",
border: 'none',
border: "none",
cursor: "pointer",
padding: "5px",
color: "#009875",
width: `${buttonWidth}px`,
height: `${buttonHeight}px`,
}
};

applyStyles(button, buttonStyles);

Expand All @@ -273,7 +278,7 @@ function decorateMultiSelection(
) {
const button = createEditTextButton(targetedElement, selection);

console.log('attaching button');
console.log("attaching button");
document.body.appendChild(button);
}

Expand Down Expand Up @@ -308,7 +313,7 @@ function applyEditor(
function removeMultiSelectionDecoration() {
const existingButton = document.querySelector("#mocksiMultiSelectEditButton");
if (existingButton) {
console.log('removing button');
console.log("removing button");
existingButton.remove();
}
}
Expand Down

0 comments on commit e57cd6a

Please sign in to comment.