mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-18 02:54:55 -06:00
When selecting text in the stacktrace frameHeader, don't toggle the frame
The frameheader is a typical target for copy/paste actions (filenames/paths) and having stuff jump around right after selecting is annoying
This commit is contained in:
@@ -88,6 +88,17 @@ function expandSection(element) {
|
||||
}
|
||||
|
||||
function toggleFrameVisibility(frameHeader) {
|
||||
console.log("toggling frame visibility");
|
||||
const selection = window.getSelection().toString();
|
||||
if (selection.length > 0) {
|
||||
// don't toggle if the user is selecting text (which one might do to copy a
|
||||
// filename or similar); the assumption here is: if there's a selection,
|
||||
// it was just created using the mouse because non-selecting mouseclick
|
||||
// deselect all text before the click is triggered. this assumption
|
||||
// holds on desktop browsers; on mobile we might need to refine this.
|
||||
return;
|
||||
}
|
||||
|
||||
const frameDetails = frameHeader.parentNode.querySelector(".js-frame-details");
|
||||
if (frameDetails.getAttribute("data-collapsed") === "true") {
|
||||
expandSection(frameDetails);
|
||||
|
||||
Reference in New Issue
Block a user