diff options
author | Phil Hughes <me@iamphill.com> | 2017-10-26 17:58:33 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-26 17:58:33 +0100 |
commit | 3811fbff7a5837bf8c7e2667c1fc1a10ed544e20 (patch) | |
tree | c6fa869c6bf3699673a332e0bd786475db344c5b /app | |
parent | 5c0c345a3a8a022b0bfdbab2efd125c42b297373 (diff) | |
download | gitlab-ce-3811fbff7a5837bf8c7e2667c1fc1a10ed544e20.tar.gz |
reset hash when changing files
[ci skip]
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_preview.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/repo/stores/actions/file.js | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/repo/components/repo_preview.vue b/app/assets/javascripts/repo/components/repo_preview.vue index 40c7811523e..bbe5c667254 100644 --- a/app/assets/javascripts/repo/components/repo_preview.vue +++ b/app/assets/javascripts/repo/components/repo_preview.vue @@ -15,8 +15,6 @@ export default { }, mounted() { this.highlightFile(); - - // TODO: get this to work across different files this.lineHighlighter = new LineHighlighter({ fileHolderSelector: '.blob-viewer-container', scrollFileHolder: true, diff --git a/app/assets/javascripts/repo/stores/actions/file.js b/app/assets/javascripts/repo/stores/actions/file.js index eb0aa506d6c..5759ff07aef 100644 --- a/app/assets/javascripts/repo/stores/actions/file.js +++ b/app/assets/javascripts/repo/stores/actions/file.js @@ -39,6 +39,9 @@ export const setFileActive = ({ commit, state, getters, dispatch }, file) => { commit(types.SET_FILE_ACTIVE, { file, active: true }); dispatch('scrollToTab'); + + // reset hash for line highlighting + location.hash = ''; }; export const getFileData = ({ state, commit, dispatch }, file) => { |