708df374f5
**Why?** It is significantly easier to manage the visibility of the modal in Vuex. The module contains the state and mutations to manage this. The component wraps GlModal and syncs the visibility with the module.
18 lines
347 B
JavaScript
18 lines
347 B
JavaScript
import * as types from './mutation_types';
|
|
|
|
export default {
|
|
[types.SHOW](state) {
|
|
state.isVisible = true;
|
|
},
|
|
[types.HIDE](state) {
|
|
state.isVisible = false;
|
|
},
|
|
[types.OPEN](state, data) {
|
|
state.data = data;
|
|
state.isVisible = true;
|
|
},
|
|
[types.CLOSE](state) {
|
|
state.data = null;
|
|
state.isVisible = false;
|
|
},
|
|
};
|