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
fc62a0fe
Commit
fc62a0fe
authored
Jul 18, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix repo_sidebar linting
parent
1f89de11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
25 deletions
+22
-25
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+3
-3
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+19
-22
No files found.
app/assets/javascripts/repo/repo_helper.js
View file @
fc62a0fe
...
...
@@ -17,14 +17,14 @@ const RepoHelper = {
getLanguageForFile
(
file
,
langs
)
{
const
ext
=
`.
${
file
.
name
.
split
(
'
.
'
).
pop
()}
`
;
let
foundLang
;
if
(
langs
.
some
((
l
)
=>
{
if
(
l
.
extensions
&&
l
.
extensions
.
indexOf
(
ext
)
>
-
1
)
{
if
(
langs
.
some
((
l
)
=>
{
if
(
l
.
extensions
&&
l
.
extensions
.
indexOf
(
ext
)
>
-
1
)
{
foundLang
=
l
;
return
true
;
}
return
false
;
}))
{
return
foundLang
.
id
return
foundLang
.
id
;
}
return
'
plain
'
;
},
...
...
app/assets/javascripts/repo/repo_sidebar.js
View file @
fc62a0fe
import
Service
from
'
./repo_service
'
import
Helper
from
'
./repo_helper
'
import
Vue
from
'
vue
'
import
Store
from
'
./repo_store
'
import
RepoPreviousDirectory
from
'
./repo_prev_directory
'
import
RepoFileOptions
from
'
./repo_file_options
'
import
RepoFile
from
'
./repo_file
'
import
RepoLoadingFile
from
'
./repo_loading_file
'
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
import
Vue
from
'
vue
'
;
import
Service
from
'
./repo_service
'
;
import
Helper
from
'
./repo_helper
'
;
import
Store
from
'
./repo_store
'
;
import
RepoPreviousDirectory
from
'
./repo_prev_directory
'
;
import
RepoFileOptions
from
'
./repo_file_options
'
;
import
RepoFile
from
'
./repo_file
'
;
import
RepoLoadingFile
from
'
./repo_loading_file
'
;
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
;
export
default
class
RepoSidebar
{
constructor
(
url
)
{
...
...
@@ -35,33 +35,30 @@ export default class RepoSidebar {
methods
:
{
addPopEventListener
()
{
window
.
addEventListener
(
'
popstate
'
,
()
=>
{
if
(
location
.
href
.
indexOf
(
'
#
'
)
>
-
1
)
return
;
if
(
location
.
href
.
indexOf
(
'
#
'
)
>
-
1
)
return
;
this
.
linkClicked
({
url
:
location
.
href
url
:
location
.
href
,
});
});
},
linkClicked
(
file
)
{
console
.
log
(
'
link clicked
'
)
let
url
=
''
;
if
(
typeof
file
===
'
object
'
)
{
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
{
if
(
typeof
file
===
'
object
'
)
{
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
{
Helper
.
removeChildFilesOfTree
(
file
);
return
;
}
else
{
url
=
file
.
url
;
Service
.
url
=
url
;
Helper
.
getContent
(
file
);
}
}
else
if
(
typeof
file
===
'
string
'
)
{
url
=
file
.
url
;
Service
.
url
=
url
;
Helper
.
getContent
(
file
);
}
else
if
(
typeof
file
===
'
string
'
)
{
// go back
url
=
file
;
Service
.
url
=
url
;
Helper
.
getContent
();
}
}
}
,
},
});
}
}
\ No newline at end of file
}
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