samplerSelect.js: update for new popup
| @@ -10,6 +10,7 @@ import { power_user } from './power-user.js'; | |||
| 10 | //import { getCfgPrompt } from './cfg-scale.js'; | 10 | //import { getCfgPrompt } from './cfg-scale.js'; |
| 11 | import { setting_names } from './textgen-settings.js'; | 11 | import { setting_names } from './textgen-settings.js'; |
| 12 | import { renderTemplateAsync } from './templates.js'; | 12 | import { renderTemplateAsync } from './templates.js'; |
| 13 | import { Popup, POPUP_TYPE } from './popup.js'; | ||
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | const TGsamplerNames = setting_names; | 16 | const TGsamplerNames = setting_names; |
| @@ -21,8 +22,6 @@ let userDisabledSamplers, userShownSamplers; | |||
| 21 | 22 | ||
| 22 | // Goal 1: show popup with all samplers for active API | 23 | // Goal 1: show popup with all samplers for active API |
| 23 | async function showSamplerSelectPopup() { | 24 | async function showSamplerSelectPopup() { |
| 24 | const popup = $('#dialogue_popup'); | ||
| 25 | popup.addClass('large_dialogue_popup'); | ||
| 26 | const html = $(document.createElement('div')); | 25 | const html = $(document.createElement('div')); |
| 27 | html.attr('id', 'sampler_view_list') | 26 | html.attr('id', 'sampler_view_list') |
| 28 | .addClass('flex-container flexFlowColumn'); | 27 | .addClass('flex-container flexFlowColumn'); |
| @@ -33,7 +32,7 @@ async function showSamplerSelectPopup() { | |||
| 33 | listContainer.append(APISamplers); | 32 | listContainer.append(APISamplers); |
| 34 | html.append(listContainer); | 33 | html.append(listContainer); |
| 35 | 34 | ||
| 36 | callPopup(html, 'text', null, { allowVerticalScrolling: true }); | 35 | const showPromise = new Popup(html, POPUP_TYPE.TEXT, null, { wide: true, large: true, allowVerticalScrolling: true }).show(); |
| 37 | 36 | ||
| 38 | setSamplerListListeners(); | 37 | setSamplerListListeners(); |
| 39 | 38 | ||
| @@ -54,6 +53,8 @@ async function showSamplerSelectPopup() { | |||
| 54 | power_user.selectSamplers.forceHidden = []; | 53 | power_user.selectSamplers.forceHidden = []; |
| 55 | await validateDisabledSamplers(); | 54 | await validateDisabledSamplers(); |
| 56 | }); | 55 | }); |
| 56 | |||
| 57 | await showPromise; | ||
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | function setSamplerListListeners() { | 60 | function setSamplerListListeners() { |