Bugs in settings fixed, profile added

This commit is contained in:
Torsten Schulz
2024-09-21 00:25:42 +02:00
parent c5a72d57d8
commit e494fe41db
65 changed files with 3121 additions and 7478 deletions

View File

@@ -7,7 +7,7 @@
<span v-if="icon" class="dialog-icon">
<img :src="'/images/icons/' + icon" alt="Icon" />
</span>
<span class="dialog-title">{{ isTitleTranslated ? $t(title) : title }}</span>
<span class="dialog-title">{{ localIsTitleTranslated ? $t(localTitle) : localTitle }}</span>
<span v-if="!modal" class="dialog-minimize" @click="minimize">_</span>
<span v-if="showClose" class="dialog-close" @click="close"></span>
</div>
@@ -73,12 +73,13 @@ export default {
isDragging: false,
dragOffsetX: 0,
dragOffsetY: 0,
localTitle: this.title,
localIsTitleTranslated: this.isTitleTranslated,
};
},
computed: {
dialogWidth() {
const val = this.width || '70%';
console.log(val);
return val;
},
dialogHeight() {
@@ -90,6 +91,9 @@ export default {
if (!newValue) {
this.minimized = false;
}
},
title(newValue) {
this.updateTitle(newValue);
}
},
methods: {
@@ -107,9 +111,13 @@ export default {
this.$store.dispatch('dialogs/removeOpenDialog', this.name);
},
buttonClick(action) {
this.$emit(action);
if (action === 'close') {
this.close();
if (typeof action === 'function') {
action(); // Wenn action eine Funktion ist, rufe sie direkt auf
} else {
this.$emit(action);
if (action === 'close') {
this.close();
}
}
},
handleOverlayClick() {
@@ -131,7 +139,6 @@ export default {
this.dragOffsetY = event.clientY - dialog.offsetTop;
document.addEventListener('mousemove', this.onDrag);
document.addEventListener('mouseup', this.stopDragging);
console.log('dragging started');
},
onDrag(event) {
if (!this.isDragging) return;
@@ -143,13 +150,15 @@ export default {
document.removeEventListener('mousemove', this.onDrag);
document.removeEventListener('mouseup', this.stopDragging);
},
},
mounted() {
this.$store.subscribe((mutation) => {
if (mutation.type === 'dialogs/toggleDialogMinimize' && mutation.payload === this.name) {
this.minimized = !this.minimized;
}
});
updateTitle(newTitle, newIsTitleTranslated) {
this.localTitle = newTitle;
this.localIsTitleTranslated = newIsTitleTranslated;
this.$store.dispatch('dialogs/updateDialogTitle', {
name: this.name,
newTitle: newTitle,
isTitleTranslated: this.localIsTitleTranslated
});
},
}
};
</script>