summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/actions.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-04-27 10:19:40 +0100
committerPhil Hughes <me@iamphill.com>2018-04-27 10:19:40 +0100
commit6a651eb721dc421297c5f52c937d25faa139bc13 (patch)
treee49cd8968864bf95f23ba7dbea0be4f406483c92 /app/assets/javascripts/ide/stores/actions.js
parent26c241d955ec0528b202792b0cb1848e9fe07691 (diff)
parenta8cb4322a07c2e167d866ed6d106f63c80c3343c (diff)
downloadgitlab-ce-6a651eb721dc421297c5f52c937d25faa139bc13.tar.gz
Merge branch 'master' into 44846-improve-web-ide-left-panel-and-modes
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions.js')
-rw-r--r--app/assets/javascripts/ide/stores/actions.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/assets/javascripts/ide/stores/actions.js b/app/assets/javascripts/ide/stores/actions.js
index ab3fb1422b8..9900eabb358 100644
--- a/app/assets/javascripts/ide/stores/actions.js
+++ b/app/assets/javascripts/ide/stores/actions.js
@@ -74,7 +74,7 @@ export const createTempEntry = (
}
worker.addEventListener('message', ({ data }) => {
- const { file } = data;
+ const { file, parentPath } = data;
worker.terminate();
@@ -90,6 +90,10 @@ export const createTempEntry = (
dispatch('setFileActive', file.path);
}
+ if (parentPath && !state.entries[parentPath].opened) {
+ commit(types.TOGGLE_TREE_OPEN, parentPath);
+ }
+
resolve(file);
});
@@ -146,6 +150,14 @@ export const setCurrentBranchId = ({ commit }, currentBranchId) => {
commit(types.SET_CURRENT_BRANCH, currentBranchId);
};
+export const updateTempFlagForEntry = ({ commit, dispatch, state }, { file, tempFile }) => {
+ commit(types.UPDATE_TEMP_FLAG, { path: file.path, tempFile });
+
+ if (file.parentPath) {
+ dispatch('updateTempFlagForEntry', { file: state.entries[file.parentPath], tempFile });
+ }
+};
+
export const toggleFileFinder = ({ commit }, fileFindVisible) =>
commit(types.TOGGLE_FILE_FINDER, fileFindVisible);