Skip to content

Commit d1b2b5b

Browse files
Fix codebox highlighting after switching files (#1647)
Shift listener into attachEvents Co-authored-by: Joey Wildman <josephwildman88@gmail.com>
1 parent 4ccfc3c commit d1b2b5b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/assets/javascripts/annotations.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ var highlightLines = function (highlight) {
288288
});
289289
};
290290

291-
$("#highlightLongLines").click(function () {
292-
highlightLines(this.checked);
293-
});
294-
295291
function displayAnnotations() {
296292

297293
$(".annotation-line").not(".base-annotation-line").remove();
@@ -305,6 +301,10 @@ function displayAnnotations() {
305301
}
306302

307303
function attachEvents() {
304+
$("#highlightLongLines").click(function () {
305+
highlightLines(this.checked);
306+
});
307+
308308
var status = $('#highlightLongLines')[0].checked;
309309
highlightLines(status);
310310

0 commit comments

Comments
 (0)