Commit b74f2faa authored by Mike Greiling's avatar Mike Greiling

use handleLocationHash utility method

parent 94715834
/* eslint-disable class-methods-use-this */ /* eslint-disable class-methods-use-this */
//= require lib/utils/url_utility */
(() => { (() => {
const UNFOLD_COUNT = 20; const UNFOLD_COUNT = 20;
...@@ -104,11 +106,11 @@ ...@@ -104,11 +106,11 @@
} }
highlighSelectedLine() { highlighSelectedLine() {
const hash = gl.utils.getLocationHash();
const $diffFiles = $('.diff-file'); const $diffFiles = $('.diff-file');
$diffFiles.find('.hll').removeClass('hll'); $diffFiles.find('.hll').removeClass('hll');
if (window.location.hash !== '') { if (hash) {
const hash = window.location.hash.replace('#', '');
$diffFiles $diffFiles
.find(`tr#${hash}:not(.match) td, td#${hash}, td[data-line-code="${hash}"]`) .find(`tr#${hash}:not(.match) td, td#${hash}, td[data-line-code="${hash}"]`)
.addClass('hll'); .addClass('hll');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment