From 9870acf6d27facfac382509ef3c0f7fede0d0621 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Thu, 4 Apr 2024 16:18:41 +0200 Subject: [PATCH] show raise/show in-app jump-to-location TODO: when multiple buttons are pressed in quick succession, the transitions may create some race-condition --- issues/templates/issues/issue_stacktrace.html | 3 +++ static/js/issue_stacktrace.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/issues/templates/issues/issue_stacktrace.html b/issues/templates/issues/issue_stacktrace.html index 0a447b5..241e8b9 100644 --- a/issues/templates/issues/issue_stacktrace.html +++ b/issues/templates/issues/issue_stacktrace.html @@ -30,6 +30,9 @@ {% with frame=frame|pygmentize %}
{# per frame div #} + {% if frame.raise_point %}{% endif %} + {% if frame.in_app %}{% endif %} + {% if forloop.first and forloop.parentloop.first %}{% endif %}
{# per frame header div #} diff --git a/static/js/issue_stacktrace.js b/static/js/issue_stacktrace.js index f922c35..dfe35b5 100644 --- a/static/js/issue_stacktrace.js +++ b/static/js/issue_stacktrace.js @@ -117,6 +117,9 @@ function showInAppFrames() { frameDetails.parentNode.querySelector(".js-chevron").classList.remove("rotate-180"); } }); + // this works because when there are repeated anchors a browser will just jump to the first one. + // the less lazy way would be to just have a single such anchor + window.location = window.location.origin + window.location.pathname + '#in-app'; } function showRaisingFrame() { @@ -129,6 +132,7 @@ function showRaisingFrame() { frameDetails.parentNode.querySelector(".js-chevron").classList.remove("rotate-180"); } }); + window.location = window.location.origin + window.location.pathname + '#raise'; } function hideAllFrames() {