From 465f4c3054bdd8c1d5b6312519be6001aad2cf38 Mon Sep 17 00:00:00 2001
From: Jacob Schatz <jschatz@gitlab.com>
Date: Thu, 16 Jun 2016 20:26:52 +0000
Subject: [PATCH] Merge branch 'tree-file-title' into 'master'

Added title attribute to entries in tree view

## What does this MR do?

Adds a title attribute to entries in the tree view. Moe useful when files have long names.

## What are the relevant issue numbers?

Closes #18353


See merge request !4709
---
 app/views/projects/tree/_blob_item.html.haml | 5 +++--
 app/views/projects/tree/_tree_item.html.haml | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/app/views/projects/tree/_blob_item.html.haml b/app/views/projects/tree/_blob_item.html.haml
index 2ddc5d504f..a3a4dba3fa 100644
--- a/app/views/projects/tree/_blob_item.html.haml
+++ b/app/views/projects/tree/_blob_item.html.haml
@@ -1,8 +1,9 @@
 %tr{ class: "tree-item #{tree_hex_class(blob_item)}" }
   %td.tree-item-file-name
     = tree_icon(type, blob_item.mode, blob_item.name)
-    %span.str-truncated
-      = link_to blob_item.name, namespace_project_blob_path(@project.namespace, @project, tree_join(@id || @commit.id, blob_item.name))
+    - file_name = blob_item.name
+    = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@id || @commit.id, blob_item.name)), title: file_name do
+      %span.str-truncated= file_name
   %td.tree_time_ago.cgray
     = render 'projects/tree/spinner'
   %td.hidden-xs.tree_commit
diff --git a/app/views/projects/tree/_tree_item.html.haml b/app/views/projects/tree/_tree_item.html.haml
index cf65057e70..9577696fc0 100644
--- a/app/views/projects/tree/_tree_item.html.haml
+++ b/app/views/projects/tree/_tree_item.html.haml
@@ -1,9 +1,9 @@
 %tr{ class: "tree-item #{tree_hex_class(tree_item)}" }
   %td.tree-item-file-name
     = tree_icon(type, tree_item.mode, tree_item.name)
-    %span.str-truncated
-      - path = flatten_tree(tree_item)
-      = link_to path, namespace_project_tree_path(@project.namespace, @project, tree_join(@id || @commit.id, path))
+    - path = flatten_tree(tree_item)
+    = link_to namespace_project_tree_path(@project.namespace, @project, tree_join(@id || @commit.id, path)), title: path do
+      %span.str-truncated= path
   %td.tree_time_ago.cgray
     = render 'projects/tree/spinner'
   %td.hidden-xs.tree_commit
-- 
2.30.9