Commit 2a2373c9 authored by Phil Hughes's avatar Phil Hughes

Restore changed file status in IDE

parent 36a242fc
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
return { return {
openModal: false, openModal: false,
modalType: '', modalType: '',
dropdownOpen: false,
}; };
}, },
methods: { methods: {
...@@ -37,18 +38,26 @@ ...@@ -37,18 +38,26 @@
hideModal() { hideModal() {
this.openModal = false; this.openModal = false;
}, },
openDropdown() {
this.dropdownOpen = !this.dropdownOpen;
},
}, },
}; };
</script> </script>
<template> <template>
<div class="repo-new-btn pull-right"> <div class="repo-new-btn pull-right">
<div class="dropdown"> <div
class="dropdown"
:class="{
open: dropdownOpen,
}"
>
<button <button
type="button" type="button"
class="btn btn-sm btn-default dropdown-toggle add-to-tree" class="btn btn-sm btn-default dropdown-toggle add-to-tree"
data-toggle="dropdown"
aria-label="Create new file or directory" aria-label="Create new file or directory"
@click.stop="openDropdown()"
> >
<icon <icon
name="plus" name="plus"
......
...@@ -93,10 +93,12 @@ export default { ...@@ -93,10 +93,12 @@ export default {
this.editor.attachModel(this.model); this.editor.attachModel(this.model);
this.model.onChange((m) => { this.model.onChange((m) => {
this.changeFileContent({ if (this.model.file.active) {
file: this.activeFile, this.changeFileContent({
content: m.getValue(), file: this.model.file,
}); content: m.getValue(),
});
}
}); });
// Handle Cursor Position // Handle Cursor Position
......
...@@ -84,7 +84,11 @@ export const handleTreeEntryAction = ({ commit, dispatch }, row) => { ...@@ -84,7 +84,11 @@ export const handleTreeEntryAction = ({ commit, dispatch }, row) => {
} else if (row.type === 'submodule') { } else if (row.type === 'submodule') {
commit(types.TOGGLE_LOADING, row); commit(types.TOGGLE_LOADING, row);
visitUrl(row.url); 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); dispatch('setFileActive', row);
} else { } else {
dispatch('getFileData', row); dispatch('getFileData', row);
...@@ -176,6 +180,7 @@ export const updateDirectoryData = ( ...@@ -176,6 +180,7 @@ export const updateDirectoryData = (
level, level,
type, type,
parentTreeUrl, parentTreeUrl,
state,
}); });
const formattedData = [ const formattedData = [
......
...@@ -161,7 +161,24 @@ export const createOrMergeEntry = ({ tree, ...@@ -161,7 +161,24 @@ export const createOrMergeEntry = ({ tree,
entry, entry,
type, type,
parentTreeUrl, 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); const found = findEntry(tree.tree || tree, type, entry.name);
if (found) { if (found) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment