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
54fa71d2
Commit
54fa71d2
authored
Jul 21, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes bugs that appeared when refactor of tree happened.
parent
e38f6fcb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
16 deletions
+18
-16
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+2
-0
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+8
-8
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+1
-1
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+6
-6
app/views/projects/tree/_tree_header.html.haml
app/views/projects/tree/_tree_header.html.haml
+1
-1
No files found.
app/assets/javascripts/repo/repo_editor.js
View file @
54fa71d2
...
...
@@ -105,7 +105,9 @@ export default class RepoEditor {
this
.
monacoInstance
.
setModel
(
null
);
const
languages
=
monaco
.
languages
.
getLanguages
();
console
.
log
(
languages
)
const
languageID
=
Helper
.
getLanguageIDForFile
(
this
.
activeFile
,
languages
);
console
.
log
(
'
languageID
'
,
languageID
)
const
newModel
=
monaco
.
editor
.
createModel
(
this
.
blobRaw
,
languageID
);
this
.
monacoInstance
.
setModel
(
newModel
);
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
54fa71d2
...
...
@@ -23,16 +23,16 @@ const RepoHelper = {
},
findLanguage
(
ext
,
langs
)
{
langs
.
find
(
lang
=>
lang
.
extensions
&&
lang
.
extensions
.
indexOf
(
`.
${
ext
}
`
)
>
-
1
);
return
langs
.
find
(
lang
=>
lang
.
extensions
&&
lang
.
extensions
.
indexOf
(
`.
${
ext
}
`
)
>
-
1
);
},
setDirectoryOpen
(
tree
)
{
if
(
!
tree
)
return
;
let
file
=
tree
;
if
(
!
file
)
return
;
/* eslint-disable no-param-reassign */
tree
.
opened
=
true
;
tree
.
icon
=
'
fa-folder-open
'
;
/* eslint-enable no-param-reassign */
file
.
opened
=
true
;
file
.
icon
=
'
fa-folder-open
'
;
return
file
;
},
getRawURLFromBlobURL
(
url
)
{
...
...
@@ -132,7 +132,7 @@ const RepoHelper = {
}
}
else
{
// it's a tree
this
.
setDirectoryOpen
(
file
);
file
=
this
.
setDirectoryOpen
(
file
);
const
newDirectory
=
this
.
dataToListOfFiles
(
data
);
Store
.
addFilesToDirectory
(
file
,
Store
.
files
,
newDirectory
);
Store
.
prevURL
=
Service
.
blobURLtoParentTree
(
Service
.
url
);
...
...
@@ -216,7 +216,7 @@ const RepoHelper = {
},
loadingError
()
{
new
Flash
(
'
Unable to load the file at this time.
'
);
// eslint-disable-line no-new
Flash
(
'
Unable to load the file at this time.
'
);
},
};
...
...
app/assets/javascripts/repo/repo_sidebar.js
View file @
54fa71d2
...
...
@@ -44,7 +44,7 @@ export default class RepoSidebar {
let
url
=
''
;
if
(
typeof
file
===
'
object
'
)
{
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
{
Store
.
removeChildFilesOfTree
(
file
);
file
=
Store
.
removeChildFilesOfTree
(
file
);
}
url
=
file
.
url
;
Service
.
url
=
url
;
...
...
app/assets/javascripts/repo/repo_store.js
View file @
54fa71d2
...
...
@@ -95,20 +95,20 @@ const RepoStore = {
this
.
activeFileLabel
=
'
Display source
'
;
},
/* eslint-disable no-param-reassign */
removeChildFilesOfTree
(
tree
)
{
let
foundTree
=
false
;
let
treetoClose
=
tree
;
this
.
files
=
this
.
files
.
filter
((
file
)
=>
{
if
(
file
.
url
===
tree
.
url
)
foundTree
=
true
;
if
(
file
.
url
===
tree
toClose
.
url
)
foundTree
=
true
;
if
(
foundTree
)
return
file
.
level
<=
tree
.
level
;
if
(
foundTree
)
return
file
.
level
<=
tree
toClose
.
level
;
return
true
;
});
tree
.
opened
=
false
;
tree
.
icon
=
'
fa-folder
'
;
treetoClose
.
opened
=
false
;
treetoClose
.
icon
=
'
fa-folder
'
;
return
treetoClose
;
},
/* eslint-enable no-param-reassign */
removeFromOpenedFiles
(
file
)
{
if
(
file
.
type
===
'
tree
'
)
return
;
...
...
app/views/projects/tree/_tree_header.html.haml
View file @
54fa71d2
...
...
@@ -3,7 +3,7 @@
=
render
'shared/ref_switcher'
,
destination:
'tree'
,
path:
@path
.tree-controls
%a
.btn.btn-default
.btn-grouped
#editable-mode
{
"href"
=>
"#"
,
"@click.prevent"
=>
"editClicked"
,
"v-cloak"
=>
1
}
%a
.btn.btn-default
#editable-mode
{
"href"
=>
"#"
,
"@click.prevent"
=>
"editClicked"
,
"v-cloak"
=>
1
}
%i
{
":class"
=>
"buttonIcon"
}
%span
{{buttonLabel}}
...
...
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