Skip to content

Commit 2e77826

Browse files
Fatima-Tahirihalaij1
authored andcommitted
Fix multiple "Scroll separately" buttons appearing
Fixes #1461
1 parent 40e6f6a commit 2e77826

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

exercise/static/exercise/assessment.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ $(function () {
115115
const tabElement = $(this);
116116
// Check if the tab contains a 'pre' element to attach buttons to
117117
const preElement = tabElement.children('pre');
118-
const extraButtons = tabElement.addStickyButton('graderFeedbackSticky');
118+
119+
// Add a sticky button only for the grader feedback tab
120+
const tabId = tabElement.attr('id');
121+
const extraButtons = tabId === 'grader-feedback' ? tabElement.addStickyButton('graderFeedbackSticky') : [];
122+
119123
if (preElement.length === 1) {
120124
// "Highlight" the grader feedback to get line numbers and buttons
121125
preElement

0 commit comments

Comments
 (0)