Merge branch 'dev' into feature/tags

This commit is contained in:
Cohee
2023-06-28 22:57:53 +03:00
committed by GitHub
10 changed files with 182 additions and 145 deletions

View File

@ -929,68 +929,43 @@ async function saveTheme() {
}
function resetMovablePanels() {
document.getElementById("sheld").style.top = '';
document.getElementById("sheld").style.left = '';
document.getElementById("sheld").style.bottom = '';
document.getElementById("sheld").style.right = '';
document.getElementById("sheld").style.height = '';
document.getElementById("sheld").style.width = '';
document.getElementById("sheld").style.margin = '';
const panelIds = [
'sheld',
'left-nav-panel',
'right-nav-panel',
'WorldInfo',
'floatingPrompt',
'expression-holder',
];
const panelStyles = ['top', 'left', 'right', 'bottom', 'height', 'width', 'margin',];
document.getElementById("left-nav-panel").style.top = '';
document.getElementById("left-nav-panel").style.left = '';
document.getElementById("left-nav-panel").style.height = '';
document.getElementById("left-nav-panel").style.width = '';
document.getElementById("left-nav-panel").style.margin = '';
panelIds.forEach((id) => {
const panel = document.getElementById(id);
document.getElementById("right-nav-panel").style.top = '';
document.getElementById("right-nav-panel").style.left = '';
document.getElementById("right-nav-panel").style.right = '';
document.getElementById("right-nav-panel").style.height = '';
document.getElementById("right-nav-panel").style.width = '';
document.getElementById("right-nav-panel").style.margin = '';
if (panel) {
panelStyles.forEach((style) => {
panel.style[style] = '';
});
}
});
document.getElementById("WorldInfo").style.top = '';
document.getElementById("WorldInfo").style.left = '';
document.getElementById("WorldInfo").style.right = '';
document.getElementById("WorldInfo").style.bottom = '';
document.getElementById("WorldInfo").style.height = '';
document.getElementById("WorldInfo").style.width = '';
document.getElementById("WorldInfo").style.margin = '';
document.getElementById("floatingPrompt").style.top = '';
document.getElementById("floatingPrompt").style.left = '';
document.getElementById("floatingPrompt").style.right = '';
document.getElementById("floatingPrompt").style.bottom = '';
document.getElementById("floatingPrompt").style.height = '';
document.getElementById("floatingPrompt").style.width = '';
document.getElementById("floatingPrompt").style.margin = '';
if ($("#expression-holder")) {
document.getElementById("expression-holder").style.top = '';
document.getElementById("expression-holder").style.left = '';
document.getElementById("expression-holder").style.right = '';
document.getElementById("expression-holder").style.bottom = '';
document.getElementById("expression-holder").style.height = '';
document.getElementById("expression-holder").style.width = '';
document.getElementById("expression-holder").style.margin = '';
const zoomedAvatar = document.querySelector('.zoomed_avatar');
if (zoomedAvatar) {
panelStyles.forEach((style) => {
zoomedAvatar.style[style] = '';
});
}
if ($(".zoomed_avatar")) {
$(".zoomed_avatar").css('top', '');
$(".zoomed_avatar").css('left', '');
$(".zoomed_avatar").css('right', '');
$(".zoomed_avatar").css('bottom', '');
$(".zoomed_avatar").css('width', '');
$(".zoomed_avatar").css('height', '');
$(".zoomed_avatar").css('margin', '');
}
$('*[data-dragged="true"]').removeAttr('data-dragged');
power_user.movingUIState = {}
$('[data-dragged="true"]').removeAttr('data-dragged');
power_user.movingUIState = {};
saveSettingsDebounced();
eventSource.emit(event_types.MOVABLE_PANELS_RESET);
eventSource.once(event_types.SETTINGS_UPDATED, () => {
toastr.success('Panel positions reset');
});
}
function doNewChat() {