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 = {
...
@@ -65,7 +65,7 @@ const RepoEditor = {
},
},
editMode
()
{
editMode
()
{
console
.
log
(
'
edit mode changed
'
)
console
.
log
(
'
edit mode changed
'
)
;
const
readOnly
=
!
this
.
editMode
;
const
readOnly
=
!
this
.
editMode
;
Store
.
readOnly
=
readOnly
;
Store
.
readOnly
=
readOnly
;
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
596e53e2
...
@@ -19,7 +19,7 @@ const RepoHelper = {
...
@@ -19,7 +19,7 @@ const RepoHelper = {
newContent
:
''
,
newContent
:
''
,
changed
:
false
,
changed
:
false
,
loading
:
false
,
loading
:
false
,
}
}
;
},
},
key
:
''
,
key
:
''
,
...
@@ -135,7 +135,7 @@ const RepoHelper = {
...
@@ -135,7 +135,7 @@ const RepoHelper = {
getContent
(
treeOrFile
,
cb
)
{
getContent
(
treeOrFile
,
cb
)
{
let
file
=
treeOrFile
;
let
file
=
treeOrFile
;
console
.
log
(
'
file
'
,
file
)
console
.
log
(
'
file
'
,
file
);
// const loadingData = RepoHelper.setLoading(true);
// const loadingData = RepoHelper.setLoading(true);
return
Service
.
getContent
()
return
Service
.
getContent
()
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
...
@@ -174,14 +174,14 @@ const RepoHelper = {
...
@@ -174,14 +174,14 @@ const RepoHelper = {
}
}
}
else
{
}
else
{
// it's a tree
// it's a tree
if
(
!
file
)
Store
.
isRoot
=
RepoHelper
.
isRoot
(
Service
.
url
);
if
(
!
file
)
Store
.
isRoot
=
RepoHelper
.
isRoot
(
Service
.
url
);
file
=
RepoHelper
.
setDirectoryOpen
(
file
);
file
=
RepoHelper
.
setDirectoryOpen
(
file
);
const
newDirectory
=
RepoHelper
.
dataToListOfFiles
(
data
);
const
newDirectory
=
RepoHelper
.
dataToListOfFiles
(
data
);
Store
.
addFilesToDirectory
(
file
,
Store
.
files
,
newDirectory
);
Store
.
addFilesToDirectory
(
file
,
Store
.
files
,
newDirectory
);
Store
.
prevURL
=
Service
.
blobURLtoParentTree
(
Service
.
url
);
Store
.
prevURL
=
Service
.
blobURLtoParentTree
(
Service
.
url
);
}
}
})
})
.
catch
((
e
)
=>
{
.
catch
(()
=>
{
// RepoHelper.setLoading(false, loadingData);
// RepoHelper.setLoading(false, loadingData);
RepoHelper
.
loadingError
();
RepoHelper
.
loadingError
();
});
});
...
...
app/assets/javascripts/repo/repo_store.js
View file @
596e53e2
...
@@ -28,7 +28,7 @@ const RepoStore = {
...
@@ -28,7 +28,7 @@ const RepoStore = {
tabsOverflow
:
41
,
tabsOverflow
:
41
,
tempPrivateToken
:
''
,
tempPrivateToken
:
''
,
submitCommitsLoading
:
false
,
submitCommitsLoading
:
false
,
binaryLoaded
:
false
,
binaryLoaded
:
false
,
activeFile
:
RepoHelper
.
getDefaultActiveFile
(),
activeFile
:
RepoHelper
.
getDefaultActiveFile
(),
activeFileIndex
:
0
,
activeFileIndex
:
0
,
activeLine
:
0
,
activeLine
:
0
,
...
@@ -137,24 +137,24 @@ const RepoStore = {
...
@@ -137,24 +137,24 @@ const RepoStore = {
if
(
file
.
type
===
'
tree
'
)
return
;
if
(
file
.
type
===
'
tree
'
)
return
;
let
foundIndex
;
let
foundIndex
;
RepoStore
.
openedFiles
=
RepoStore
.
openedFiles
.
filter
((
openedFile
,
i
)
=>
{
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
;
return
openedFile
.
url
!==
file
.
url
;
});
});
// now activate the right tab based on what you closed.
// now activate the right tab based on what you closed.
if
(
RepoStore
.
openedFiles
.
length
===
0
)
{
if
(
RepoStore
.
openedFiles
.
length
===
0
)
{
console
.
log
(
'
open 0
'
)
console
.
log
(
'
open 0
'
)
;
RepoStore
.
activeFile
=
{};
RepoStore
.
activeFile
=
{};
return
;
return
;
}
}
if
(
RepoStore
.
openedFiles
.
length
===
1
||
foundIndex
===
0
)
{
if
(
RepoStore
.
openedFiles
.
length
===
1
||
foundIndex
===
0
)
{
RepoStore
.
setActiveFiles
(
RepoStore
.
openedFiles
[
0
]);
RepoStore
.
setActiveFiles
(
RepoStore
.
openedFiles
[
0
]);
return
;
return
;
}
}
if
(
foundIndex
)
{
if
(
foundIndex
)
{
if
(
foundIndex
>
0
)
{
if
(
foundIndex
>
0
)
{
RepoStore
.
setActiveFiles
(
RepoStore
.
openedFiles
[
foundIndex
-
1
]);
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';
...
@@ -3,7 +3,7 @@ import repoCommitSection from '~/repo/repo_commit_section.vue';
import
RepoStore
from
'
~/repo/repo_store
'
;
import
RepoStore
from
'
~/repo/repo_store
'
;
import
Api
from
'
~/api
'
;
import
Api
from
'
~/api
'
;
f
describe
(
'
RepoCommitSection
'
,
()
=>
{
describe
(
'
RepoCommitSection
'
,
()
=>
{
const
openedFiles
=
[{
const
openedFiles
=
[{
id
:
0
,
id
:
0
,
changed
:
true
,
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