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

actions.js « pane « modules « stores « ide « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8fcdf539ec46f1c962cf46fe7f0ca875313bfa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as types from './mutation_types';

export const toggleOpen = ({ dispatch, state }) => {
  if (state.isOpen) {
    dispatch('close');
  } else {
    dispatch('open');
  }
};

export const open = ({ state, commit }, view) => {
  commit(types.SET_OPEN, true);

  if (view && view.name !== state.currentView) {
    const { name, keepAlive } = view;

    commit(types.SET_CURRENT_VIEW, name);

    if (keepAlive) {
      commit(types.KEEP_ALIVE_VIEW, name);
    }
  }
};

export const close = ({ commit }) => {
  commit(types.SET_OPEN, false);
};

// prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {};