mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
buttonify instruct header toggles, style instruct columns when disabled
This commit is contained in:
@ -87,8 +87,16 @@ export async function loadInstructMode(data) {
|
||||
|
||||
if (power_user.instruct.enabled) {
|
||||
$('#instruct_enabled').parent().find('i').addClass('toggleEnabled');
|
||||
$('#instructSettingsBlock, #InstructSequencesColumn').removeClass('disabled');
|
||||
} else {
|
||||
$('#instruct_enabled').parent().find('i').removeClass('toggleEnabled');
|
||||
$('#instructSettingsBlock, #InstructSequencesColumn').addClass('disabled');
|
||||
}
|
||||
|
||||
if (power_user.instruct.bind_to_context) {
|
||||
$('#instruct_bind_to_context').parent().find('i').addClass('toggleEnabled');
|
||||
} else {
|
||||
$('#instruct_bind_to_context').parent().find('i').removeClass('toggleEnabled');
|
||||
}
|
||||
|
||||
controls.forEach(control => {
|
||||
@ -639,8 +647,12 @@ jQuery(() => {
|
||||
//color toggle for the main switch
|
||||
if (power_user.instruct.enabled) {
|
||||
$('#instruct_enabled').parent().find('i').addClass('toggleEnabled');
|
||||
$('#instructSettingsBlock, #InstructSequencesColumn')
|
||||
.removeClass('disabled');
|
||||
} else {
|
||||
$('#instruct_enabled').parent().find('i').removeClass('toggleEnabled');
|
||||
$('#instructSettingsBlock, #InstructSequencesColumn')
|
||||
.addClass('disabled');
|
||||
}
|
||||
|
||||
if (!power_user.instruct.bind_to_context) {
|
||||
@ -656,6 +668,14 @@ jQuery(() => {
|
||||
}
|
||||
});
|
||||
|
||||
$('#instruct_bind_to_context').on('change', function () {
|
||||
if (power_user.instruct.bind_to_context) {
|
||||
$('#instruct_bind_to_context').parent().find('i').addClass('toggleEnabled');
|
||||
} else {
|
||||
$('#instruct_bind_to_context').parent().find('i').removeClass('toggleEnabled');
|
||||
}
|
||||
});
|
||||
|
||||
$('#instruct_presets').on('change', function () {
|
||||
const name = String($(this).find(':selected').val());
|
||||
const preset = instruct_presets.find(x => x.name === name);
|
||||
|
Reference in New Issue
Block a user