diff options
-rw-r--r-- | app/assets/javascripts/ide/stores/actions.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/mutation_types.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/mutations.js | 10 |
3 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/stores/actions.js b/app/assets/javascripts/ide/stores/actions.js index af4bc4b2e19..fd9a4d975cf 100644 --- a/app/assets/javascripts/ide/stores/actions.js +++ b/app/assets/javascripts/ide/stores/actions.js @@ -50,6 +50,14 @@ export const toggleBlobView = ({ commit, state }) => { } }; +export const setLeftBarCollapsedStatus = ({ commit, state }, collapsed) => { + commit(types.SET_LEFT_BAR_COLLAPSED, collapsed); +}; + +export const setRightBarCollapsedStatus = ({ commit, state }, collapsed) => { + commit(types.SET_RIGHT_BAR_COLLAPSED, collapsed); +}; + export const checkCommitStatus = ({ state }) => service.getBranchData( state.currentProjectId, state.currentBranchId, diff --git a/app/assets/javascripts/ide/stores/mutation_types.js b/app/assets/javascripts/ide/stores/mutation_types.js index 154e1017756..b0bab6f7269 100644 --- a/app/assets/javascripts/ide/stores/mutation_types.js +++ b/app/assets/javascripts/ide/stores/mutation_types.js @@ -4,6 +4,8 @@ export const SET_COMMIT_REF = 'SET_COMMIT_REF'; export const SET_PARENT_TREE_URL = 'SET_PARENT_TREE_URL'; export const SET_ROOT = 'SET_ROOT'; export const SET_LAST_COMMIT_DATA = 'SET_LAST_COMMIT_DATA'; +export const SET_LEFT_BAR_COLLAPSED = 'SET_LEFT_BAR_COLLAPSED'; +export const SET_RIGHT_BAR_COLLAPSED = 'SET_RIGHT_BAR_COLLAPSED'; // Project Mutation Types export const SET_PROJECT = 'SET_PROJECT'; diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js index 2e68a24ca91..030f3bde00c 100644 --- a/app/assets/javascripts/ide/stores/mutations.js +++ b/app/assets/javascripts/ide/stores/mutations.js @@ -44,6 +44,16 @@ export default { isInitialRoot: isRoot, }); }, + [types.SET_LEFT_BAR_COLLAPSED](state, collapsed) { + Object.assign(state, { + leftBarCollapsed: collapsed, + }); + }, + [types.SET_RIGHT_BAR_COLLAPSED](state, collapsed) { + Object.assign(state, { + rightBarCollapsed: collapsed, + }); + }, [types.SET_LAST_COMMIT_DATA](state, { entry, lastCommit }) { Object.assign(entry.lastCommit, { id: lastCommit.commit.id, |