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
71d08bfb
Commit
71d08bfb
authored
Jul 26, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove active file when no files are open.
parent
d52172fa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+18
-1
repo_store.js
app/assets/javascripts/repo/repo_store.js
+6
-18
No files found.
app/assets/javascripts/repo/repo_helper.js
View file @
71d08bfb
...
@@ -4,6 +4,24 @@ import Store from './repo_store';
...
@@ -4,6 +4,24 @@ import Store from './repo_store';
import
'../flash'
;
import
'../flash'
;
const
RepoHelper
=
{
const
RepoHelper
=
{
getDefaultActiveFile
()
{
return
{
active
:
true
,
binary
:
false
,
extension
:
''
,
html
:
''
,
mime_type
:
''
,
name
:
'loading...'
,
plain
:
''
,
size
:
0
,
url
:
''
,
raw
:
false
,
newContent
:
''
,
changed
:
false
,
loading
:
false
,
}
},
key
:
''
,
key
:
''
,
isTree
(
data
)
{
isTree
(
data
)
{
...
@@ -165,7 +183,6 @@ const RepoHelper = {
...
@@ -165,7 +183,6 @@ const RepoHelper = {
})
})
.
catch
((
e
)
=>
{
.
catch
((
e
)
=>
{
// RepoHelper.setLoading(false, loadingData);
// RepoHelper.setLoading(false, loadingData);
console
.
log
(
'catch'
,
e
)
RepoHelper
.
loadingError
();
RepoHelper
.
loadingError
();
});
});
},
},
...
...
app/assets/javascripts/repo/repo_store.js
View file @
71d08bfb
...
@@ -29,21 +29,7 @@ const RepoStore = {
...
@@ -29,21 +29,7 @@ const RepoStore = {
tempPrivateToken
:
''
,
tempPrivateToken
:
''
,
submitCommitsLoading
:
false
,
submitCommitsLoading
:
false
,
binaryLoaded
:
false
,
binaryLoaded
:
false
,
activeFile
:
{
activeFile
:
RepoHelper
.
getDefaultActiveFile
(),
active
:
true
,
binary
:
false
,
extension
:
''
,
html
:
''
,
mime_type
:
''
,
name
:
'loading...'
,
plain
:
''
,
size
:
0
,
url
:
''
,
raw
:
false
,
newContent
:
''
,
changed
:
false
,
loading
:
false
,
},
activeFileIndex
:
0
,
activeFileIndex
:
0
,
activeLine
:
0
,
activeLine
:
0
,
activeFileLabel
:
'Raw'
,
activeFileLabel
:
'Raw'
,
...
@@ -66,7 +52,6 @@ const RepoStore = {
...
@@ -66,7 +52,6 @@ const RepoStore = {
readOnly
:
true
,
readOnly
:
true
,
// mutations
// mutations
checkIsCommitable
()
{
checkIsCommitable
()
{
RepoStore
.
service
.
checkCurrentBranchIsCommitable
()
RepoStore
.
service
.
checkCurrentBranchIsCommitable
()
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
...
@@ -89,7 +74,6 @@ const RepoStore = {
...
@@ -89,7 +74,6 @@ const RepoStore = {
setActiveFiles
(
file
)
{
setActiveFiles
(
file
)
{
if
(
RepoStore
.
isActiveFile
(
file
))
return
;
if
(
RepoStore
.
isActiveFile
(
file
))
return
;
RepoStore
.
openedFiles
=
RepoStore
.
openedFiles
RepoStore
.
openedFiles
=
RepoStore
.
openedFiles
.
map
((
openedFile
,
i
)
=>
RepoStore
.
setFileActivity
(
file
,
openedFile
,
i
));
.
map
((
openedFile
,
i
)
=>
RepoStore
.
setFileActivity
(
file
,
openedFile
,
i
));
...
@@ -158,7 +142,11 @@ const RepoStore = {
...
@@ -158,7 +142,11 @@ const RepoStore = {
});
});
// 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
)
return
;
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
]);
RepoStore
.
setActiveFiles
(
RepoStore
.
openedFiles
[
0
]);
...
...
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