From 01b965f6daf22eaeb511d35d3312c217cb1f2d33 Mon Sep 17 00:00:00 2001
From: Phil Hughes <me@iamphill.com>
Date: Tue, 23 Feb 2016 13:41:03 +0000
Subject: [PATCH] Correctly checks if tree view is on screen

---
 app/assets/javascripts/dispatcher.js.coffee | 2 +-
 app/controllers/projects/refs_controller.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index 7eda9a18a51..4c6cf3417e8 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -77,7 +77,7 @@ class Dispatcher
       when 'projects:show'
         shortcut_handler = new ShortcutsNavigation()
 
-        new TreeView() if $('#tree-slider')
+        new TreeView() if $('#tree-slider').length
       when 'groups:show'
         new Activities()
         shortcut_handler = new ShortcutsNavigation()
diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb
index 8aeff064732..00df1c9c965 100644
--- a/app/controllers/projects/refs_controller.rb
+++ b/app/controllers/projects/refs_controller.rb
@@ -64,7 +64,7 @@ class Projects::RefsController < Projects::ApplicationController
       }
     end
 
-    offset = (@offset +  @limit)
+    offset = (@offset + @limit)
     if contents.size > offset
       @more_log_url = logs_file_namespace_project_ref_path(@project.namespace, @project, @ref, @path || '', offset: offset)
     end
-- 
GitLab