Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-03-22 19:45:31 +0300
committerPhil Hughes <me@iamphill.com>2018-03-28 16:08:28 +0300
commit002cc923898335cbd3a1068d914fb09696e7f8e5 (patch)
treea02d30e2fdaa551a3538a68ecbdc66462d13b8f1 /app/assets/javascripts/ide/stores/mutations
parentb3fb82a9d28571d90e45220c62dd70d7004a42bd (diff)
Added pending tabs to IDE
Pending tabs are normal tabs that are opened from the right sidebar. They are opened in diff mode and when changed to edit mode they get closed & the actual file gets opened.
Diffstat (limited to 'app/assets/javascripts/ide/stores/mutations')
-rw-r--r--app/assets/javascripts/ide/stores/mutations/file.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/stores/mutations/file.js b/app/assets/javascripts/ide/stores/mutations/file.js
index 2500f13db7c..915126f10eb 100644
--- a/app/assets/javascripts/ide/stores/mutations/file.js
+++ b/app/assets/javascripts/ide/stores/mutations/file.js
@@ -80,4 +80,18 @@ export default {
changed,
});
},
+ [types.ADD_PENDING_TAB](state, file) {
+ Object.assign(state, {
+ pendingTabs: state.pendingTabs.concat({
+ ...file,
+ active: true,
+ pending: true,
+ }),
+ });
+ },
+ [types.REMOVE_PENDING_TAB](state, file) {
+ Object.assign(state, {
+ pendingTabs: state.pendingTabs.filter(f => f.path !== file.path),
+ });
+ },
};