Skip to content

Commit

Permalink
Merge pull request #5309 from Martchus/key-handling
Browse files Browse the repository at this point in the history
Fix key navigation on test details
  • Loading branch information
mergify[bot] committed Sep 21, 2023
2 parents d2a7168 + f1b115c commit e134982
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions assets/javascripts/test_result.js
Expand Up @@ -644,16 +644,20 @@ function renderTestModules(response) {
setCurrentPreviewFromStepLinkIfPossible($("[href='" + hash + "'], [data-href='" + hash + "']"));
}

// setup keyboard navigation through test details
$(window).keydown(handleKeyDownOnTestDetails);

// ensure the size of the preview container is adjusted when the window size changes
$(window).resize(function () {
const currentPreview = $('.current_preview');
if (currentPreview.length) {
setCurrentPreview($('.current_preview'), true);
}
});
// setup event handlers for the window
if (!this.hasWindowEventHandlers) {
// setup keyboard navigation through test details
$(window).keydown(handleKeyDownOnTestDetails);

// ensure the size of the preview container is adjusted when the window size changes
$(window).resize(function () {
const currentPreview = $('.current_preview');
if (currentPreview.length) {
setCurrentPreview($('.current_preview'), true);
}
});
this.hasWindowEventHandlers = true;
}

// setup result filter, define function to apply filter changes
const detailsFilter = $('#details-filter');
Expand Down

0 comments on commit e134982

Please sign in to comment.