Skip to content

Commit

Permalink
fix reference tasks label icon position issue
Browse files Browse the repository at this point in the history
  • Loading branch information
erinz2020 committed Mar 15, 2023
1 parent 8c1df7f commit 66df3ee
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions assets/simple-boxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,22 +710,22 @@ window.simpleBoxes._.methods = {
}

let labelContentString = "";
const offsetLeft = document.querySelector("#scrollBoxLeft").scrollLeft;
const offsetTop = document.querySelector("#scrollBoxLeft").scrollTop;

if(handle.readOnly){
if(document.querySelector("#scrollBoxLeft") && handle.readOnly) {
const offsetLeft = document.querySelector("#scrollBoxLeft").scrollLeft;
const offsetTop = document.querySelector("#scrollBoxLeft").scrollTop;

labelContentString = `
<i class="bi labelContent tagIcon"
data-handle-id="${handle.id}"
data-box-id="${copy.id}"
style="
top: ${labelContentY - offsetTop }px;
left: ${copy.x - offsetLeft}px;
width: ${(currentLabel || activeLabel).length * 10}px !important
">${finalLabel }
</i>
`;
} else {
<i class="bi labelContent tagIcon"
data-handle-id="${handle.id}"
data-box-id="${copy.id}"
style="
top: ${labelContentY - offsetTop }px;
left: ${copy.x - offsetLeft}px;
width: ${(currentLabel || activeLabel).length * 10}px !important
">${finalLabel }
</i>
`;
}else {
labelContentString = `
<i class="bi labelContent tagIcon"
data-handle-id="${handle.id}"
Expand Down

0 comments on commit 66df3ee

Please sign in to comment.