You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
willaengine/resources/js/Global/store/modules/modal/actions.js

33 lines
1.1 KiB

export default {
$_openModal: ({ rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = true;
} else {
rootState.modal[modalArray[0]] = true;
}
},
$_openModalCallback: ({ commit }, data) => {
commit(data.module + '/OPEN_MODAL_' + data.type.toUpperCase(), data, { root: true });
},
$_closeModalCallback: ({ commit }, data) => {
commit(data.module + '/CLOSE_MODAL_' + data.type.toUpperCase(), data, { root: true });
},
$_closeModal: ({ state, rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = false;
} else {
rootState.modal[modalArray[0]] = false;
}
state.properties = null;
},
dialog:({state, commit}, properties) => {
state.modal.dialog = true;
commit('SET_DIALOG_TYPE', properties.type);
commit('SET_DIALOG_PROPERTIES', properties);
},
};