BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0c4f512b
Commit
0c4f512b
authored
Jul 14, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'find-file-no-longer-inline' into 'master'
Move find file URL out of global variable See merge request !12846
parents
1afdbe32
6bbdce64
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
12 deletions
+10
-12
shortcuts.js
app/assets/javascripts/shortcuts.js
+1
-1
projects_helper.rb
app/helpers/projects_helper.rb
+8
-0
application.html.haml
app/views/layouts/application.html.haml
+1
-1
_default.html.haml
app/views/layouts/header/_default.html.haml
+0
-5
_new.html.haml
app/views/layouts/header/_new.html.haml
+0
-5
No files found.
app/assets/javascripts/shortcuts.js
View file @
0c4f512b
/* 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'
);
...
...
app/helpers/projects_helper.rb
View file @
0c4f512b
...
...
@@ -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
app/views/layouts/application.html.haml
View file @
0c4f512b
!!! 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"
...
...
app/views/layouts/header/_default.html.haml
View file @
0c4f512b
...
...
@@ -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
)
}
"
;
app/views/layouts/header/_new.html.haml
View file @
0c4f512b
...
...
@@ -84,8 +84,3 @@
=
icon
(
'times'
,
class:
'js-navbar-toggle-left'
,
style:
'display: none;'
)
=
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