mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
samplerSelect.js: update for new popup
This commit is contained in:
@@ -10,6 +10,7 @@ import { power_user } from './power-user.js';
|
|||||||
//import { getCfgPrompt } from './cfg-scale.js';
|
//import { getCfgPrompt } from './cfg-scale.js';
|
||||||
import { setting_names } from './textgen-settings.js';
|
import { setting_names } from './textgen-settings.js';
|
||||||
import { renderTemplateAsync } from './templates.js';
|
import { renderTemplateAsync } from './templates.js';
|
||||||
|
import { Popup, POPUP_TYPE } from './popup.js';
|
||||||
|
|
||||||
|
|
||||||
const TGsamplerNames = setting_names;
|
const TGsamplerNames = setting_names;
|
||||||
@@ -21,8 +22,6 @@ let userDisabledSamplers, userShownSamplers;
|
|||||||
|
|
||||||
// Goal 1: show popup with all samplers for active API
|
// Goal 1: show popup with all samplers for active API
|
||||||
async function showSamplerSelectPopup() {
|
async function showSamplerSelectPopup() {
|
||||||
const popup = $('#dialogue_popup');
|
|
||||||
popup.addClass('large_dialogue_popup');
|
|
||||||
const html = $(document.createElement('div'));
|
const html = $(document.createElement('div'));
|
||||||
html.attr('id', 'sampler_view_list')
|
html.attr('id', 'sampler_view_list')
|
||||||
.addClass('flex-container flexFlowColumn');
|
.addClass('flex-container flexFlowColumn');
|
||||||
@@ -33,7 +32,7 @@ async function showSamplerSelectPopup() {
|
|||||||
listContainer.append(APISamplers);
|
listContainer.append(APISamplers);
|
||||||
html.append(listContainer);
|
html.append(listContainer);
|
||||||
|
|
||||||
callPopup(html, 'text', null, { allowVerticalScrolling: true });
|
const showPromise = new Popup(html, POPUP_TYPE.TEXT, null, { wide: true, large: true, allowVerticalScrolling: true }).show();
|
||||||
|
|
||||||
setSamplerListListeners();
|
setSamplerListListeners();
|
||||||
|
|
||||||
@@ -54,6 +53,8 @@ async function showSamplerSelectPopup() {
|
|||||||
power_user.selectSamplers.forceHidden = [];
|
power_user.selectSamplers.forceHidden = [];
|
||||||
await validateDisabledSamplers();
|
await validateDisabledSamplers();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await showPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSamplerListListeners() {
|
function setSamplerListListeners() {
|
||||||
|
Reference in New Issue
Block a user