Finished guestbook and gallery. started diary
This commit is contained in:
@@ -12,9 +12,20 @@ const mutations = {
|
||||
if (!state.openDialogs.find((d) => d.dialog.name === dialog.dialog.name)) {
|
||||
state.openDialogs.push(dialog);
|
||||
}
|
||||
state.openDialogs.forEach((dlg) => {
|
||||
dlg.dialog.setActiveState(false);
|
||||
});
|
||||
dialog.dialog.setActiveState(true);
|
||||
},
|
||||
removeOpenDialog(state, dialogName) {
|
||||
state.openDialogs = state.openDialogs.filter((dialog) => dialog.dialog.name !== dialogName);
|
||||
let activeIsSet = false;
|
||||
state.openDialogs.forEach((dialog) => {
|
||||
if (!dialog.dialog.isMinimized() && !activeIsSet) {
|
||||
dialog.dialog.setActiveState(true);
|
||||
activeIsSet = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleDialogMinimize(state, dialogName) {
|
||||
if (minimizing) {
|
||||
@@ -30,7 +41,6 @@ const mutations = {
|
||||
updateDialogTitle(state, { name, newTitle, isTitleTranslated }) {
|
||||
const dialogIndex = state.openDialogs.findIndex((d) => d.dialog.name === name);
|
||||
if (dialogIndex !== -1) {
|
||||
// Update dialog object reactively
|
||||
const updatedDialog = {
|
||||
...state.openDialogs[dialogIndex],
|
||||
dialog: {
|
||||
@@ -39,8 +49,6 @@ const mutations = {
|
||||
isTitleTranslated: isTitleTranslated
|
||||
}
|
||||
};
|
||||
|
||||
// Replace the old dialog with the updated one
|
||||
state.openDialogs.splice(dialogIndex, 1, updatedDialog);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user