Fix settings in plugin page using profiles from settings dialog

This commit is contained in:
JannisX11 2024-10-12 14:24:19 +02:00
parent a48834d4b7
commit 934f63a1ee
2 changed files with 10 additions and 6 deletions

View File

@ -723,6 +723,7 @@ const Settings = {
}
Settings.dialog.show();
if (options.search_term) Settings.dialog.content_vue.search_term = options.search_term;
if (options.profile) Settings.dialog.content_vue.profile = options.profile;
Settings.dialog.content_vue.$forceUpdate();
},
old: {}

View File

@ -1096,6 +1096,9 @@ BARS.defineActions(function() {
Settings.saveLocalStorages();
}, 20);
},
openSettingInSettings(key, profile) {
Settings.openDialog({search_term: key, profile});
},
settingContextMenu(setting, event) {
new Menu([
{
@ -1478,13 +1481,13 @@ BARS.defineActions(function() {
@contextmenu="settingContextMenu(setting, $event)"
>
<template v-if="setting.type === 'number'">
<div class="setting_element"><numeric-input v-model.number="setting.ui_value" :min="setting.min" :max="setting.max" :step="setting.step" @input="changePluginSetting(setting)" /></div>
<div class="setting_element"><numeric-input v-model.number="setting.master_value" :min="setting.min" :max="setting.max" :step="setting.step" @input="changePluginSetting(setting)" /></div>
</template>
<template v-else-if="setting.type === 'click'">
<div class="setting_element setting_icon" v-html="getIconNode(setting.icon).outerHTML"></div>
</template>
<template v-else-if="setting.type == 'toggle'"><!--TOGGLE-->
<div class="setting_element"><input type="checkbox" v-model="setting.ui_value" v-bind:id="'setting_'+key" @click="changePluginSetting(setting)"></div>
<div class="setting_element"><input type="checkbox" v-model="setting.master_value" v-bind:id="'setting_'+key" @click="changePluginSetting(setting)"></div>
</template>
<div class="setting_label">
@ -1494,17 +1497,17 @@ BARS.defineActions(function() {
:style="{'--color-profile': markerColors[profile_here.color] && markerColors[profile_here.color].standard}"
:class="{active: profile_here.isActive()}"
:title="tl('Has override in profile ' + profile_here.name)"
@click.stop="profile = (profile == profile_here) ? null : profile_here"
@click.stop="openSettingInSettings(key, profile_here)"
/>
<div class="setting_description">{{ setting.description }}</div>
</div>
<template v-if="setting.type === 'text'">
<input type="text" class="dark_bordered" style="width: 96%" v-model="setting.ui_value" @input="changePluginSetting(setting)">
<input type="text" class="dark_bordered" style="width: 96%" v-model="setting.master_value" @input="changePluginSetting(setting)">
</template>
<template v-if="setting.type === 'password'">
<input :type="setting.hidden ? 'password' : 'text'" class="dark_bordered" style="width: calc(96% - 28px);" v-model="setting.ui_value" @input="changePluginSetting(setting)">
<input :type="setting.hidden ? 'password' : 'text'" class="dark_bordered" style="width: calc(96% - 28px);" v-model="setting.master_value" @input="changePluginSetting(setting)">
<div class="password_toggle" @click="setting.hidden = !setting.hidden;">
<i class="fas fa-eye-slash" v-if="setting.hidden"></i>
<i class="fas fa-eye" v-else></i>
@ -1513,7 +1516,7 @@ BARS.defineActions(function() {
<template v-else-if="setting.type === 'select'">
<div class="bar_select">
<select-input v-model="setting.ui_value" :options="setting.options" @change="changePluginSetting"setting />
<select-input v-model="setting.master_value" :options="setting.options" @change="changePluginSetting"setting />
</div>
</template>
</li>