Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e578530f
Commit
e578530f
authored
7 years ago
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move find file URL out of global variable
Part of #34903
parent
48b976e0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
app/assets/javascripts/shortcuts.js
app/assets/javascripts/shortcuts.js
+1
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+8
-0
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+1
-1
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+0
-5
No files found.
app/assets/javascripts/shortcuts.js
View file @
e578530f
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, prefer-arrow-callback, consistent-return, object-shorthand, no-unused-vars, one-var, one-var-declaration-per-line, no-else-return, comma-dangle, max-len */
/* global Mousetrap */
/* global findFileURL */
import
Cookies
from
'
js-cookie
'
;
import
findAndFollowLink
from
'
./shortcuts_dashboard_navigation
'
;
...
...
@@ -20,6 +19,7 @@ import findAndFollowLink from './shortcuts_dashboard_navigation';
const
$globalDropdownMenu
=
$
(
'
.global-dropdown-menu
'
);
const
$globalDropdownToggle
=
$
(
'
.global-dropdown-toggle
'
);
const
findFileURL
=
document
.
body
.
dataset
.
findFile
;
$
(
'
.global-dropdown
'
).
on
(
'
hide.bs.dropdown
'
,
()
=>
{
$globalDropdownMenu
.
removeClass
(
'
shortcuts
'
);
...
...
This diff is collapsed.
Click to expand it.
app/helpers/projects_helper.rb
View file @
e578530f
...
...
@@ -518,4 +518,12 @@ module ProjectsHelper
current_application_settings
.
restricted_visibility_levels
||
[]
end
def
find_file_path
return
unless
@project
&&
!
@project
.
empty_repo?
ref
=
@ref
||
@project
.
repository
.
root_ref
project_find_file_path
(
@project
,
ref
)
end
end
This diff is collapsed.
Click to expand it.
app/views/layouts/application.html.haml
View file @
e578530f
!!! 5
%html
{
lang:
I18n
.
locale
,
class:
"#{page_class}"
}
=
render
"layouts/head"
%body
{
class:
@body_class
,
data:
{
page:
body_data_page
,
project:
"#{@project.path if @project}"
,
group:
"#{@group.path if @group}"
}
}
%body
{
class:
@body_class
,
data:
{
page:
body_data_page
,
project:
"#{@project.path if @project}"
,
group:
"#{@group.path if @group}"
,
find_file:
find_file_path
}
}
=
render
"layouts/init_auto_complete"
if
@gfm_form
-
if
show_new_nav?
=
render
"layouts/header/new"
...
...
This diff is collapsed.
Click to expand it.
app/views/layouts/header/_default.html.haml
View file @
e578530f
...
...
@@ -91,8 +91,3 @@
=
yield
:header_content
=
render
'shared/outdated_browser'
-
if
@project
&&
!
@project
.
empty_repo?
-
if
ref
=
@ref
||
@project
.
repository
.
root_ref
:javascript
var
findFileURL
=
"
#{
project_find_file_path
(
@project
,
ref
)
}
"
;
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment