Improved Advanced Formatting UI

This commit is contained in:
Stefan Daniel Schwarz
2023-08-25 21:04:06 +02:00
parent be3ebcda0d
commit ca37ac679e
4 changed files with 101 additions and 74 deletions

View File

@@ -6,6 +6,7 @@ import {
power_user,
context_presets,
} from "./power-user.js";
import { resetScrollHeight } from "./utils.js";
/**
* @type {any[]} Instruct mode presets.
@@ -55,6 +56,9 @@ export function loadInstructMode(data) {
$element.on('input', function () {
power_user.instruct[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
saveSettingsDebounced();
if (!control.isCheckbox) {
resetScrollHeight($element);
}
});
});

View File

@@ -29,7 +29,7 @@ import {
import { registerSlashCommand } from "./slash-commands.js";
import { tokenizers } from "./tokenizers.js";
import { delay } from "./utils.js";
import { delay, resetScrollHeight } from "./utils.js";
export {
loadPowerUserSettings,
@@ -906,6 +906,9 @@ function loadContextSettings() {
$element.on('input', function () {
power_user.context[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
saveSettingsDebounced();
if (!control.isCheckbox) {
resetScrollHeight($element);
}
});
});