mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-12-15 05:01:38 +08:00
Fix settings in plugin page using profiles from settings dialog
This commit is contained in:
parent
a48834d4b7
commit
934f63a1ee
@ -723,6 +723,7 @@ const Settings = {
|
|||||||
}
|
}
|
||||||
Settings.dialog.show();
|
Settings.dialog.show();
|
||||||
if (options.search_term) Settings.dialog.content_vue.search_term = options.search_term;
|
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();
|
Settings.dialog.content_vue.$forceUpdate();
|
||||||
},
|
},
|
||||||
old: {}
|
old: {}
|
||||||
|
@ -1096,6 +1096,9 @@ BARS.defineActions(function() {
|
|||||||
Settings.saveLocalStorages();
|
Settings.saveLocalStorages();
|
||||||
}, 20);
|
}, 20);
|
||||||
},
|
},
|
||||||
|
openSettingInSettings(key, profile) {
|
||||||
|
Settings.openDialog({search_term: key, profile});
|
||||||
|
},
|
||||||
settingContextMenu(setting, event) {
|
settingContextMenu(setting, event) {
|
||||||
new Menu([
|
new Menu([
|
||||||
{
|
{
|
||||||
@ -1478,13 +1481,13 @@ BARS.defineActions(function() {
|
|||||||
@contextmenu="settingContextMenu(setting, $event)"
|
@contextmenu="settingContextMenu(setting, $event)"
|
||||||
>
|
>
|
||||||
<template v-if="setting.type === 'number'">
|
<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>
|
||||||
<template v-else-if="setting.type === 'click'">
|
<template v-else-if="setting.type === 'click'">
|
||||||
<div class="setting_element setting_icon" v-html="getIconNode(setting.icon).outerHTML"></div>
|
<div class="setting_element setting_icon" v-html="getIconNode(setting.icon).outerHTML"></div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="setting.type == 'toggle'"><!--TOGGLE-->
|
<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>
|
</template>
|
||||||
|
|
||||||
<div class="setting_label">
|
<div class="setting_label">
|
||||||
@ -1494,17 +1497,17 @@ BARS.defineActions(function() {
|
|||||||
:style="{'--color-profile': markerColors[profile_here.color] && markerColors[profile_here.color].standard}"
|
:style="{'--color-profile': markerColors[profile_here.color] && markerColors[profile_here.color].standard}"
|
||||||
:class="{active: profile_here.isActive()}"
|
:class="{active: profile_here.isActive()}"
|
||||||
:title="tl('Has override in profile ' + profile_here.name)"
|
: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 class="setting_description">{{ setting.description }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-if="setting.type === 'text'">
|
<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>
|
||||||
|
|
||||||
<template v-if="setting.type === 'password'">
|
<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;">
|
<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-slash" v-if="setting.hidden"></i>
|
||||||
<i class="fas fa-eye" v-else></i>
|
<i class="fas fa-eye" v-else></i>
|
||||||
@ -1513,7 +1516,7 @@ BARS.defineActions(function() {
|
|||||||
|
|
||||||
<template v-else-if="setting.type === 'select'">
|
<template v-else-if="setting.type === 'select'">
|
||||||
<div class="bar_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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user