diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-19 15:01:02 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-19 15:01:02 +0300 |
commit | 79b498169e139d1e195110db7b022713c80fe06b (patch) | |
tree | ade3834e2a32e0558d34153bcfc9c97de1b108fb /app/assets/javascripts/ide/stores/actions.js | |
parent | aadde87f42e4b705b652f009a9681c48de2b9c61 (diff) | |
parent | 54e262965d213ad7b3b258f54805485c3110040a (diff) |
Merge branch 'master' into ide-file-finder
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions.js')
-rw-r--r-- | app/assets/javascripts/ide/stores/actions.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/stores/actions.js b/app/assets/javascripts/ide/stores/actions.js index 57420b6c699..7158e94b6c3 100644 --- a/app/assets/javascripts/ide/stores/actions.js +++ b/app/assets/javascripts/ide/stores/actions.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; import Vue from 'vue'; import { visitUrl } from '~/lib/utils/url_utility'; import flash from '~/flash'; @@ -32,6 +33,22 @@ export const setPanelCollapsedStatus = ({ commit }, { side, collapsed }) => { } }; +export const toggleRightPanelCollapsed = ( + { dispatch, state }, + e = undefined, +) => { + if (e) { + $(e.currentTarget) + .tooltip('hide') + .blur(); + } + + dispatch('setPanelCollapsedStatus', { + side: 'right', + collapsed: !state.rightPanelCollapsed, + }); +}; + export const setResizingStatus = ({ commit }, resizing) => { commit(types.SET_RESIZING_STATUS, resizing); }; @@ -104,6 +121,14 @@ export const scrollToTab = () => { }); }; +export const stageAllChanges = ({ state, commit }) => { + state.changedFiles.forEach(file => commit(types.STAGE_CHANGE, file.path)); +}; + +export const unstageAllChanges = ({ state, commit }) => { + state.stagedFiles.forEach(file => commit(types.UNSTAGE_CHANGE, file.path)); +}; + export const updateViewer = ({ commit }, viewer) => { commit(types.UPDATE_VIEWER, viewer); }; |