mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Implement "except" mode for type-specific controls in settings
This commit is contained in:
@@ -838,7 +838,14 @@ jQuery(function () {
|
||||
|
||||
function showTypeSpecificControls(type) {
|
||||
$('[data-tg-type]').each(function () {
|
||||
const mode = String($(this).attr('data-tg-type-mode') ?? '').toLowerCase().trim();
|
||||
const tgTypes = $(this).attr('data-tg-type').split(',').map(x => x.trim());
|
||||
|
||||
if (mode === 'except') {
|
||||
$(this)[tgTypes.includes(type) ? 'hide' : 'show']();
|
||||
return;
|
||||
}
|
||||
|
||||
for (const tgType of tgTypes) {
|
||||
if (tgType === type || tgType == 'all') {
|
||||
$(this).show();
|
||||
|
Reference in New Issue
Block a user