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
Jul 13, 2017
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 */
/* 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 Mousetrap */
/* global findFileURL */
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
findAndFollowLink
from
'
./shortcuts_dashboard_navigation
'
;
import
findAndFollowLink
from
'
./shortcuts_dashboard_navigation
'
;
...
@@ -20,6 +19,7 @@ import findAndFollowLink from './shortcuts_dashboard_navigation';
...
@@ -20,6 +19,7 @@ import findAndFollowLink from './shortcuts_dashboard_navigation';
const
$globalDropdownMenu
=
$
(
'
.global-dropdown-menu
'
);
const
$globalDropdownMenu
=
$
(
'
.global-dropdown-menu
'
);
const
$globalDropdownToggle
=
$
(
'
.global-dropdown-toggle
'
);
const
$globalDropdownToggle
=
$
(
'
.global-dropdown-toggle
'
);
const
findFileURL
=
document
.
body
.
dataset
.
findFile
;
$
(
'
.global-dropdown
'
).
on
(
'
hide.bs.dropdown
'
,
()
=>
{
$
(
'
.global-dropdown
'
).
on
(
'
hide.bs.dropdown
'
,
()
=>
{
$globalDropdownMenu
.
removeClass
(
'
shortcuts
'
);
$globalDropdownMenu
.
removeClass
(
'
shortcuts
'
);
...
...
app/helpers/projects_helper.rb
View file @
e578530f
...
@@ -518,4 +518,12 @@ module ProjectsHelper
...
@@ -518,4 +518,12 @@ module ProjectsHelper
current_application_settings
.
restricted_visibility_levels
||
[]
current_application_settings
.
restricted_visibility_levels
||
[]
end
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
end
app/views/layouts/application.html.haml
View file @
e578530f
!!! 5
!!! 5
%html
{
lang:
I18n
.
locale
,
class:
"#{page_class}"
}
%html
{
lang:
I18n
.
locale
,
class:
"#{page_class}"
}
=
render
"layouts/head"
=
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
=
render
"layouts/init_auto_complete"
if
@gfm_form
-
if
show_new_nav?
-
if
show_new_nav?
=
render
"layouts/header/new"
=
render
"layouts/header/new"
...
...
app/views/layouts/header/_default.html.haml
View file @
e578530f
...
@@ -91,8 +91,3 @@
...
@@ -91,8 +91,3 @@
=
yield
:header_content
=
yield
:header_content
=
render
'shared/outdated_browser'
=
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
)
}
"
;
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