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
2a2373c9
Commit
2a2373c9
authored
Feb 09, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore changed file status in IDE
parent
36a242fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
8 deletions
+41
-8
app/assets/javascripts/ide/components/new_dropdown/index.vue
app/assets/javascripts/ide/components/new_dropdown/index.vue
+11
-2
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+6
-4
app/assets/javascripts/ide/stores/actions/tree.js
app/assets/javascripts/ide/stores/actions/tree.js
+6
-1
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+18
-1
No files found.
app/assets/javascripts/ide/components/new_dropdown/index.vue
View file @
2a2373c9
...
...
@@ -27,6 +27,7 @@
return
{
openModal
:
false
,
modalType
:
''
,
dropdownOpen
:
false
,
};
},
methods
:
{
...
...
@@ -37,18 +38,26 @@
hideModal
()
{
this
.
openModal
=
false
;
},
openDropdown
()
{
this
.
dropdownOpen
=
!
this
.
dropdownOpen
;
},
},
};
</
script
>
<
template
>
<div
class=
"repo-new-btn pull-right"
>
<div
class=
"dropdown"
>
<div
class=
"dropdown"
:class=
"
{
open: dropdownOpen,
}"
>
<button
type=
"button"
class=
"btn btn-sm btn-default dropdown-toggle add-to-tree"
data-toggle=
"dropdown"
aria-label=
"Create new file or directory"
@
click.stop=
"openDropdown()"
>
<icon
name=
"plus"
...
...
app/assets/javascripts/ide/components/repo_editor.vue
View file @
2a2373c9
...
...
@@ -93,10 +93,12 @@ export default {
this
.
editor
.
attachModel
(
this
.
model
);
this
.
model
.
onChange
((
m
)
=>
{
this
.
changeFileContent
({
file
:
this
.
activeFile
,
content
:
m
.
getValue
(),
});
if
(
this
.
model
.
file
.
active
)
{
this
.
changeFileContent
({
file
:
this
.
model
.
file
,
content
:
m
.
getValue
(),
});
}
});
// Handle Cursor Position
...
...
app/assets/javascripts/ide/stores/actions/tree.js
View file @
2a2373c9
...
...
@@ -84,7 +84,11 @@ export const handleTreeEntryAction = ({ commit, dispatch }, row) => {
}
else
if
(
row
.
type
===
'
submodule
'
)
{
commit
(
types
.
TOGGLE_LOADING
,
row
);
visitUrl
(
row
.
url
);
}
else
if
(
row
.
type
===
'
blob
'
&&
row
.
opened
)
{
}
else
if
(
row
.
type
===
'
blob
'
&&
(
row
.
opened
||
row
.
changed
))
{
if
(
row
.
changed
)
{
commit
(
types
.
TOGGLE_FILE_OPEN
,
row
);
}
dispatch
(
'
setFileActive
'
,
row
);
}
else
{
dispatch
(
'
getFileData
'
,
row
);
...
...
@@ -176,6 +180,7 @@ export const updateDirectoryData = (
level
,
type
,
parentTreeUrl
,
state
,
});
const
formattedData
=
[
...
...
app/assets/javascripts/ide/stores/utils.js
View file @
2a2373c9
...
...
@@ -161,7 +161,24 @@ export const createOrMergeEntry = ({ tree,
entry
,
type
,
parentTreeUrl
,
level
})
=>
{
level
,
state
})
=>
{
if
(
state
.
changedFiles
.
length
)
{
const
foundChangedFileFile
=
findEntry
(
state
.
changedFiles
,
type
,
entry
.
name
);
if
(
foundChangedFileFile
)
{
return
foundChangedFileFile
;
}
}
if
(
state
.
openFiles
.
length
)
{
const
foundOpenFile
=
findEntry
(
state
.
openFiles
,
type
,
entry
.
path
);
if
(
foundOpenFile
)
{
return
foundOpenFile
;
}
}
const
found
=
findEntry
(
tree
.
tree
||
tree
,
type
,
entry
.
name
);
if
(
found
)
{
...
...
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