Commit b32a6add authored by Fatih Acet's avatar Fatih Acet

Merge branch 'fix_filebrowser_reload' into 'master'

File Browser navigation fixes

Fixes a double request being made when clicking the file name when navigating through file browser and also fixes opening a file in a new tab or when doing ctrl + click.

Closes #19050

**Before**

![navigation-old](/uploads/f9a40c91e430e31beae3a896cffb1c68/navigation-old.gif)

**After**

![navigation](/uploads/dec9b43894c00cc09d80d19c83506530/navigation.gif)


See merge request !4891
parents 48843c0d d17046db
...@@ -24,6 +24,9 @@ v 8.10.0 (unreleased) ...@@ -24,6 +24,9 @@ v 8.10.0 (unreleased)
- Allow [ci skip] to be in any case and allow [skip ci]. !4785 (simon_w) - Allow [ci skip] to be in any case and allow [skip ci]. !4785 (simon_w)
- Add basic system information like memory and disk usage to the admin panel - Add basic system information like memory and disk usage to the admin panel
v 8.9.4 (unreleased)
- Fixes middle click and double request when navigating through the file browser !4891
v 8.9.3 v 8.9.3
- Fix encrypted data backwards compatibility after upgrading attr_encrypted gem. !4963 - Fix encrypted data backwards compatibility after upgrading attr_encrypted gem. !4963
- Fix rendering of commit notes. !4953 - Fix rendering of commit notes. !4953
......
...@@ -5,9 +5,15 @@ class @TreeView ...@@ -5,9 +5,15 @@ class @TreeView
# Code browser tree slider # Code browser tree slider
# Make the entire tree-item row clickable, but not if clicking another link (like a commit message) # Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
$(".tree-content-holder .tree-item").on 'click', (e) -> $(".tree-content-holder .tree-item").on 'click', (e) ->
if (e.target.nodeName != "A") $clickedEl = $(e.target)
path = $('.tree-item-file-name a', this).attr('href') path = $('.tree-item-file-name a', this).attr('href')
Turbolinks.visit(path)
if not $clickedEl.is('a') and not $clickedEl.is('.str-truncated')
if e.metaKey or e.which is 2
e.preventDefault()
window.open path, '_blank'
else
Turbolinks.visit path
# Show the "Loading commit data" for only the first element # Show the "Loading commit data" for only the first element
$('span.log_loading:first').removeClass('hide') $('span.log_loading:first').removeClass('hide')
......
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