diff options
author | Phil Hughes <me@iamphill.com> | 2018-01-08 13:45:56 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-01-09 14:29:57 +0300 |
commit | 500a3de7b4be05b797c9da6c6d535a4edf65db5e (patch) | |
tree | 2de351a7640ba3ebc4db3b3f67ef08a2ad7f8bd5 /app/helpers/diff_helper.rb | |
parent | 82e2d90b519e76fe6d73f791f610da1a425e6091 (diff) |
Fix changes dropdown ellipsis working across browsers
Closes #41561
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r-- | app/helpers/diff_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 1ce487e6592..0f5fc2823a3 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -226,4 +226,12 @@ module DiffHelper diffs.overflow? end + + def diff_file_path_text(diff_file, max: 60) + path = diff_file.new_path + + return path unless path.size > max && max > 3 + + "...#{path[-(max - 3)..-1]}" + end end |