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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
596e53e2
Commit
596e53e2
authored
Jul 27, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix eslint offenses
parent
e58d30a0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+1
-1
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+4
-4
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+8
-8
spec/javascripts/repo/repo_commit_section_spec.js
spec/javascripts/repo/repo_commit_section_spec.js
+1
-1
No files found.
app/assets/javascripts/repo/repo_editor.js
View file @
596e53e2
...
...
@@ -65,7 +65,7 @@ const RepoEditor = {
},
editMode
()
{
console
.
log
(
'
edit mode changed
'
)
console
.
log
(
'
edit mode changed
'
)
;
const
readOnly
=
!
this
.
editMode
;
Store
.
readOnly
=
readOnly
;
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
596e53e2
...
...
@@ -19,7 +19,7 @@ const RepoHelper = {
newContent
:
''
,
changed
:
false
,
loading
:
false
,
}
}
;
},
key
:
''
,
...
...
@@ -135,7 +135,7 @@ const RepoHelper = {
getContent
(
treeOrFile
,
cb
)
{
let
file
=
treeOrFile
;
console
.
log
(
'
file
'
,
file
)
console
.
log
(
'
file
'
,
file
);
// const loadingData = RepoHelper.setLoading(true);
return
Service
.
getContent
()
.
then
((
response
)
=>
{
...
...
@@ -174,14 +174,14 @@ const RepoHelper = {
}
}
else
{
// it's a tree
if
(
!
file
)
Store
.
isRoot
=
RepoHelper
.
isRoot
(
Service
.
url
);
if
(
!
file
)
Store
.
isRoot
=
RepoHelper
.
isRoot
(
Service
.
url
);
file
=
RepoHelper
.
setDirectoryOpen
(
file
);
const
newDirectory
=
RepoHelper
.
dataToListOfFiles
(
data
);
Store
.
addFilesToDirectory
(
file
,
Store
.
files
,
newDirectory
);
Store
.
prevURL
=
Service
.
blobURLtoParentTree
(
Service
.
url
);
}
})
.
catch
((
e
)
=>
{
.
catch
(()
=>
{
// RepoHelper.setLoading(false, loadingData);
RepoHelper
.
loadingError
();
});
...
...
app/assets/javascripts/repo/repo_store.js
View file @
596e53e2
...
...
@@ -28,7 +28,7 @@ const RepoStore = {
tabsOverflow
:
41
,
tempPrivateToken
:
''
,
submitCommitsLoading
:
false
,
binaryLoaded
:
false
,
binaryLoaded
:
false
,
activeFile
:
RepoHelper
.
getDefaultActiveFile
(),
activeFileIndex
:
0
,
activeLine
:
0
,
...
...
@@ -137,24 +137,24 @@ const RepoStore = {
if
(
file
.
type
===
'
tree
'
)
return
;
let
foundIndex
;
RepoStore
.
openedFiles
=
RepoStore
.
openedFiles
.
filter
((
openedFile
,
i
)
=>
{
if
(
openedFile
.
url
===
file
.
url
)
foundIndex
=
i
;
if
(
openedFile
.
url
===
file
.
url
)
foundIndex
=
i
;
return
openedFile
.
url
!==
file
.
url
;
});
// now activate the right tab based on what you closed.
if
(
RepoStore
.
openedFiles
.
length
===
0
)
{
console
.
log
(
'
open 0
'
)
if
(
RepoStore
.
openedFiles
.
length
===
0
)
{
console
.
log
(
'
open 0
'
)
;
RepoStore
.
activeFile
=
{};
return
;
}
if
(
RepoStore
.
openedFiles
.
length
===
1
||
foundIndex
===
0
)
{
if
(
RepoStore
.
openedFiles
.
length
===
1
||
foundIndex
===
0
)
{
RepoStore
.
setActiveFiles
(
RepoStore
.
openedFiles
[
0
]);
return
;
}
if
(
foundIndex
)
{
if
(
foundIndex
>
0
)
{
if
(
foundIndex
)
{
if
(
foundIndex
>
0
)
{
RepoStore
.
setActiveFiles
(
RepoStore
.
openedFiles
[
foundIndex
-
1
]);
}
}
...
...
spec/javascripts/repo/repo_commit_section_spec.js
View file @
596e53e2
...
...
@@ -3,7 +3,7 @@ import repoCommitSection from '~/repo/repo_commit_section.vue';
import
RepoStore
from
'
~/repo/repo_store
'
;
import
Api
from
'
~/api
'
;
f
describe
(
'
RepoCommitSection
'
,
()
=>
{
describe
(
'
RepoCommitSection
'
,
()
=>
{
const
openedFiles
=
[{
id
:
0
,
changed
:
true
,
...
...
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