diff options
author | Phil Hughes <me@iamphill.com> | 2018-03-22 19:45:31 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-03-28 16:08:28 +0300 |
commit | 002cc923898335cbd3a1068d914fb09696e7f8e5 (patch) | |
tree | a02d30e2fdaa551a3538a68ecbdc66462d13b8f1 /app/assets/javascripts/ide/stores/mutations | |
parent | b3fb82a9d28571d90e45220c62dd70d7004a42bd (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.js | 14 |
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), + }); + }, }; |