Fix issue with styling in plugin dialogs

Fix cannot set empty string as settings override value
Fix color in menu items on hover
Add nullish coalescing as browser requirement
This commit is contained in:
JannisX11 2023-02-04 12:42:11 +01:00
parent 69078ca5ea
commit 489964cf31
4 changed files with 7 additions and 5 deletions

View File

@ -594,6 +594,7 @@
.contextMenu li.focused,
.contextMenu li.parent.opened {
background-color: var(--color-accent);
color: var(--color-accent_text);
}
.contextMenu li.hybrid_parent.opened {
background-color: transparent;

View File

@ -54,8 +54,9 @@
<script>
// Browser compatibility check
try {
eval('window?.document');
eval('window?.document ?? 2');
} catch (err) {
console.error(err);
let error_element = document.querySelector('#loading_error_detail')
error_element.innerHTML = `Incompatible browser version. Please update your web browser.`
}

View File

@ -326,9 +326,9 @@ function buildLines(dialog) {
dialog.max_label_width = Math.max(getStringWidth(widget.name), dialog.max_label_width)
}
dialog.uses_wide_inputs = true;
dialog_content.append(bar)
dialog_content.append(bar);
} else {
dialog_content.append(DOMPurify.sanitize(l))
dialog_content.append(l);
}
})
}

View File

@ -71,7 +71,7 @@ class Setting {
get value() {
let profile = SettingsProfile.all.find(profile => profile.isActive() && profile.settings[this.id] !== undefined);
if (profile) {
return profile.settings[this.id] || this.master_value;
return profile.settings[this.id] ?? this.master_value;
} else {
return this.master_value;
}
@ -82,7 +82,7 @@ class Setting {
get ui_value() {
let profile = Settings.dialog.content_vue?.profile;
if (profile) {
return profile.settings[this.id] || this.master_value;
return profile.settings[this.id] ?? this.master_value;
} else {
return this.master_value;
}