Fix sizing of textareas in settings modal

This commit is contained in:
Webifi 2023-05-29 21:25:40 -05:00
parent 56eca2620e
commit c20c5da931
2 changed files with 17 additions and 12 deletions

View File

@ -96,6 +96,13 @@
<span class="menu-icon"><Fa icon={faClone}/></span> Clone Chat
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) restartChatSession() }}>
<span class="menu-icon"><Fa icon={faRotateRight}/></span> Restart Chat Session
</a>
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); clearMessages(chatId) }}>
<span class="menu-icon"><Fa icon={faEraser}/></span> Clear Chat Messages
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { close(); exportChatAsJSON(chatId) }}>
<span class="menu-icon"><Fa icon={faDownload}/></span> Backup Chat JSON
</a>
@ -106,13 +113,6 @@
<span class="menu-icon"><Fa icon={faFileExport}/></span> Export Chat Markdown
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) restartChatSession() }}>
<span class="menu-icon"><Fa icon={faRotateRight}/></span> Restart Chat Session
</a>
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); clearMessages(chatId) }}>
<span class="menu-icon"><Fa icon={faEraser}/></span> Clear Chat Messages
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); deleteChat() }}>
<span class="menu-icon"><Fa icon={faTrash}/></span> Delete Chat
</a>

View File

@ -26,6 +26,7 @@
faUpload
} from '@fortawesome/free-solid-svg-icons/index'
import { exportProfileAsJSON } from './Export.svelte'
import { afterUpdate } from 'svelte'
export let chatId:number
export const show = () => { showSettings() }
@ -45,6 +46,10 @@
$: chatSettings = chat.settings
$: globalStore = $globalStorage
afterUpdate(() => {
sizeTextElements()
})
const closeSettings = () => {
showProfileMenu = false
$checkStateChange++
@ -164,7 +169,7 @@
// Refresh settings modal
showSettingsModal++
setTimeout(() => sizeTextElements, 100)
setTimeout(() => sizeTextElements(), 0)
}
const debounce = {}
@ -260,6 +265,10 @@
<span class="menu-icon"><Fa icon={faClone}/></span> Clone Profile
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" on:click|preventDefault={pinDefaultProfile}>
<span class="menu-icon"><Fa icon={faThumbtack}/></span> Set as Default Profile
</a>
<hr class="dropdown-divider">
<a href={'#'}
class="dropdown-item"
on:click|preventDefault={() => { showProfileMenu = false; exportProfileAsJSON(chatId) }}
@ -270,10 +279,6 @@
<span class="menu-icon"><Fa icon={faUpload}/></span> Restore Profile JSON
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" on:click|preventDefault={pinDefaultProfile}>
<span class="menu-icon"><Fa icon={faThumbtack}/></span> Set as Default Profile
</a>
<hr class="dropdown-divider">
<a href={'#'} class="dropdown-item" on:click|preventDefault={deleteProfile}>
<span class="menu-icon"><Fa icon={faTrash}/></span> Delete Profile
</a>