mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix reset on generic draggables
This commit is contained in:
@ -41,7 +41,7 @@ import { tokenizers } from './tokenizers.js';
|
|||||||
import { BIAS_CACHE } from './logit-bias.js';
|
import { BIAS_CACHE } from './logit-bias.js';
|
||||||
import { renderTemplateAsync } from './templates.js';
|
import { renderTemplateAsync } from './templates.js';
|
||||||
|
|
||||||
import { countOccurrences, debounce, delay, download, getFileText, isOdd, resetScrollHeight, shuffle, sortMoments, stringToRange, timestampToMoment } from './utils.js';
|
import { countOccurrences, debounce, delay, download, getFileText, isOdd, onlyUnique, resetScrollHeight, shuffle, sortMoments, stringToRange, timestampToMoment } from './utils.js';
|
||||||
import { FILTER_TYPES } from './filters.js';
|
import { FILTER_TYPES } from './filters.js';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@ -2339,12 +2339,14 @@ async function resetMovablePanels(type) {
|
|||||||
'cfgConfig',
|
'cfgConfig',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {HTMLElement[]} Generic panels that don't have a known ID
|
||||||
|
*/
|
||||||
|
const draggedElements = Array.from(document.querySelectorAll('[data-dragged]'));
|
||||||
|
const allDraggable = panelIds.map(id => document.getElementById(id)).concat(draggedElements).filter(onlyUnique);
|
||||||
|
|
||||||
const panelStyles = ['top', 'left', 'right', 'bottom', 'height', 'width', 'margin'];
|
const panelStyles = ['top', 'left', 'right', 'bottom', 'height', 'width', 'margin'];
|
||||||
|
allDraggable.forEach((panel) => {
|
||||||
panelIds.forEach((id) => {
|
|
||||||
console.log(id);
|
|
||||||
const panel = document.getElementById(id);
|
|
||||||
|
|
||||||
if (panel) {
|
if (panel) {
|
||||||
$(panel).addClass('resizing');
|
$(panel).addClass('resizing');
|
||||||
panelStyles.forEach((style) => {
|
panelStyles.forEach((style) => {
|
||||||
@ -2353,7 +2355,10 @@ async function resetMovablePanels(type) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const zoomedAvatars = document.querySelectorAll('.zoomed_avatar');
|
/**
|
||||||
|
* @type {HTMLElement[]} Zoomed avatars that are currently being resized
|
||||||
|
*/
|
||||||
|
const zoomedAvatars = Array.from(document.querySelectorAll('.zoomed_avatar'));
|
||||||
if (zoomedAvatars.length > 0) {
|
if (zoomedAvatars.length > 0) {
|
||||||
zoomedAvatars.forEach((avatar) => {
|
zoomedAvatars.forEach((avatar) => {
|
||||||
avatar.classList.add('resizing');
|
avatar.classList.add('resizing');
|
||||||
|
Reference in New Issue
Block a user