Commit 6263a3ca authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'files-view-row-click' into 'master'

Fixes issue with file view rows not clickable on project main view

Fixed an issue where it would only load the first 25 commit data on project main view.

Stopped the file view sending 1 too many requests.

Fixes #3916

See merge request !2933
parents 1ff17b6b 01b965f6
...@@ -76,6 +76,8 @@ class Dispatcher ...@@ -76,6 +76,8 @@ class Dispatcher
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
when 'projects:show' when 'projects:show'
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
new TreeView() if $('#tree-slider').length
when 'groups:show' when 'groups:show'
new Activities() new Activities()
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
......
...@@ -64,9 +64,9 @@ class Projects::RefsController < Projects::ApplicationController ...@@ -64,9 +64,9 @@ class Projects::RefsController < Projects::ApplicationController
} }
end end
if @logs.present? offset = (@offset + @limit)
@log_url = namespace_project_tree_url(@project.namespace, @project, tree_join(@ref, @path || '/')) if contents.size > offset
@more_log_url = logs_file_namespace_project_ref_path(@project.namespace, @project, @ref, @path || '', offset: (@offset + @limit)) @more_log_url = logs_file_namespace_project_ref_path(@project.namespace, @project, @ref, @path || '', offset: offset)
end end
respond_to do |format| respond_to do |format|
......
...@@ -8,12 +8,9 @@ ...@@ -8,12 +8,9 @@
row.find("td.tree_time_ago").html('#{escape_javascript time_ago_with_tooltip(commit.committed_date)}'); row.find("td.tree_time_ago").html('#{escape_javascript time_ago_with_tooltip(commit.committed_date)}');
row.find("td.tree_commit").html('#{escape_javascript render("projects/tree/tree_commit_column", commit: commit)}'); row.find("td.tree_commit").html('#{escape_javascript render("projects/tree/tree_commit_column", commit: commit)}');
- if @logs.present? - if @more_log_url
:plain :plain
var current_url = location.href.replace(/\/?$/, '/'); if($('#tree-slider').length) {
var log_url = "#{escape_javascript(@log_url)}".replace(/\/?$/, '/');
if(current_url == log_url) {
// Load more commit logs for each file in tree // Load more commit logs for each file in tree
// if we still on the same page // if we still on the same page
var url = "#{escape_javascript(@more_log_url)}"; var url = "#{escape_javascript(@more_log_url)}";
......
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