Skip to content
Snippets Groups Projects
Commit 5f57234c authored by Sam Rose's avatar Sam Rose
Browse files

Hightlight linenumber on page load

parent e9d75a4b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -25,6 +25,10 @@ require('./lib/utils/url_utility');
isBound = true;
}
 
if (gl.utils.getLocationHash()) {
this.highlightSelectedLine();
}
this.openAnchoredDiff();
}
 
Loading
Loading
@@ -78,7 +82,7 @@ require('./lib/utils/url_utility');
if (nothingHereBlock.length) {
const clickTarget = $('.js-file-title, .click-to-expand', diffFile);
diffFile.data('singleFileDiff').toggleDiff(clickTarget, () => {
this.highlighSelectedLine();
this.highlightSelectedLine();
if (cb) cb();
});
} else if (cb) {
Loading
Loading
@@ -94,7 +98,7 @@ require('./lib/utils/url_utility');
} else {
window.location.hash = hash;
}
this.highlighSelectedLine();
this.highlightSelectedLine();
}
 
diffViewType() {
Loading
Loading
@@ -108,7 +112,7 @@ require('./lib/utils/url_utility');
return line.find('.diff-line-num').map((i, elm) => parseInt($(elm).data('linenumber'), 10));
}
 
highlighSelectedLine() {
highlightSelectedLine() {
const hash = gl.utils.getLocationHash();
const $diffFiles = $('.diff-file');
$diffFiles.find('.hll').removeClass('hll');
Loading
Loading
---
title: Highlight line number if specified on diff pages when page loads
merge_request: 9664
author:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment