summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-10-04 17:22:07 +0200
committerTim Zallmann <tzallmann@gitlab.com>2017-10-04 17:27:56 +0200
commit8d14a95638d7d6b52254b192b3e54296e22fddc3 (patch)
tree3dbd81575e6643a9b40ee9a4c583467747a5e21e
parent0a671c8223d7fab14acdb40d30a7a74696885d75 (diff)
downloadgitlab-ce-8d14a95638d7d6b52254b192b3e54296e22fddc3.tar.gz
Optimising If
-rw-r--r--app/assets/javascripts/repo/components/repo_sidebar.vue4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/repo/components/repo_sidebar.vue b/app/assets/javascripts/repo/components/repo_sidebar.vue
index 0e6acf96836..9f58f63b850 100644
--- a/app/assets/javascripts/repo/components/repo_sidebar.vue
+++ b/app/assets/javascripts/repo/components/repo_sidebar.vue
@@ -42,8 +42,8 @@ export default {
const lineNumber = Number(location.hash.substr(2));
if (!isNaN(lineNumber)) {
Store.setActiveLine(lineNumber);
- if (Store.isPreviewView()) {
- if (document.getElementById(`L${lineNumber}`)) document.getElementById(`L${lineNumber}`).scrollIntoView();
+ if (Store.isPreviewView() && document.getElementById(`L${lineNumber}`)) {
+ document.getElementById(`L${lineNumber}`).scrollIntoView();
} else {
Helper.monacoInstance.setPosition({
lineNumber: this.activeLine,