Skip to content

Commit bd29e3e

Browse files
authored
Merge pull request #2236 from Urgau/gha-logs-mobile-detection
Fix the mobile detection in our GHA logs viewer
2 parents eb06c0c + 6f1166d commit bd29e3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gha_logs/gha_logs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ logsEl.innerHTML = html;
7878

7979
// 7. If no anchor is given, scroll to the last error
8080
if (location.hash === "" && errorCounter >= 0) {
81-
const hasSmallViewport = window.innerWidth <= 750;
81+
const hasSmallViewport = window.outerWidth <= 750;
8282
document.getElementById(`error-${errorCounter}`).scrollIntoView({
8383
behavior: 'instant',
8484
block: 'end',
@@ -100,7 +100,7 @@ if (location.hash !== "") {
100100
highlightTimestampRange(startId, endId);
101101

102102
// Scroll to the highlighted part (either the timestamp or the log line depending on the viewport size)
103-
const hasSmallViewport = window.innerWidth <= 750;
103+
const hasSmallViewport = window.outerWidth <= 750;
104104
const scrollToElement = hasSmallViewport ? startRow.querySelector("td:nth-child(2)") : startRow;
105105

106106
scrollToElement.scrollIntoView({

0 commit comments

Comments
 (0)