Skip to content

Commit

Permalink
Code-folding: Insert triangles before other nodes (#142)
Browse files Browse the repository at this point in the history
Fix text selection when user starts selection clicking on the triangle
  • Loading branch information
murphyne authored Apr 1, 2021
1 parent 7d67001 commit 7faff0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions github-code-folding.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
elm = $(".ghcf-collapser", codeLines[start - 1]);
elm.parentNode.insertBefore(
ellipsis.cloneNode(true),
elm.nextSibling
null
);
}
});
Expand Down Expand Up @@ -221,7 +221,7 @@
// prepend triangle
el = triangle.cloneNode();
el.dataset.depth = count + 1;
codeLines[top].appendChild(el, codeLines[top].childNodes[0]);
codeLines[top].insertBefore(el, codeLines[top].childNodes[0]);
stack.pop();
return tryPair();
}
Expand Down

0 comments on commit 7faff0a

Please sign in to comment.