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.2 KiB

5 years ago
export default {
5 years ago
$_openModal: ({ rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = true;
5 years ago
// if (typeof rootState[modalArray[0]]['callback_modal'] != "undefined" && typeof rootState[modalArray[0]]['callback_modal'][modalArray[1]] != "undefined") {
// }
5 years ago
} else {
rootState.modal[modalArray[0]] = true;
5 years ago
}
},
5 years ago
$_closeModal: ({ state, rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = false;
5 years ago
// if (typeof rootState[modalArray[0]]['callback_modal'] != "undefined" && typeof rootState[modalArray[0]]['callback_modal'][modalArray[1]] != "undefined") {
// }
5 years ago
} else {
rootState.modal[modalArray[0]] = false;
5 years ago
}
state.properties = null;
},
5 years ago
dialog:({state, commit}, properties) => {
state.modal.dialog = true;
commit('SET_DIALOG_TYPE', properties.type);
commit('SET_DIALOG_PROPERTIES', properties);
},
5 years ago
};