mirror of
https://github.com/open-webui/open-webui
synced 2025-03-04 19:38:54 +00:00
refac
This commit is contained in:
parent
e90e254575
commit
737b1723c7
@ -129,6 +129,7 @@
|
||||
export let isLastMessage = true;
|
||||
export let readOnly = false;
|
||||
|
||||
let buttonsContainerElement: HTMLDivElement;
|
||||
let showDeleteConfirm = false;
|
||||
|
||||
let model = null;
|
||||
@ -518,6 +519,18 @@
|
||||
// console.log('ResponseMessage mounted');
|
||||
|
||||
await tick();
|
||||
if (buttonsContainerElement) {
|
||||
console.log(buttonsContainerElement);
|
||||
buttonsContainerElement.addEventListener('wheel', function (event) {
|
||||
// console.log(event.deltaY);
|
||||
|
||||
event.preventDefault();
|
||||
if (event.deltaY !== 0) {
|
||||
// Adjust horizontal scroll position based on vertical scroll
|
||||
buttonsContainerElement.scrollLeft += event.deltaY;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -802,10 +815,11 @@
|
||||
</div>
|
||||
|
||||
{#if !edit}
|
||||
{#if message.done || siblings.length > 1}
|
||||
<div
|
||||
class=" flex justify-start overflow-x-auto buttons text-gray-600 dark:text-gray-500 mt-0.5"
|
||||
>
|
||||
<div
|
||||
bind:this={buttonsContainerElement}
|
||||
class="flex justify-start overflow-x-auto buttons text-gray-600 dark:text-gray-500 mt-0.5"
|
||||
>
|
||||
{#if message.done || siblings.length > 1}
|
||||
{#if siblings.length > 1}
|
||||
<div class="flex self-center min-w-fit" dir="ltr">
|
||||
<button
|
||||
@ -1313,20 +1327,20 @@
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if message.done && showRateComment}
|
||||
<RateComment
|
||||
bind:message
|
||||
bind:show={showRateComment}
|
||||
on:save={async (e) => {
|
||||
await feedbackHandler(null, {
|
||||
...e.detail
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
{#if message.done && showRateComment}
|
||||
<RateComment
|
||||
bind:message
|
||||
bind:show={showRateComment}
|
||||
on:save={async (e) => {
|
||||
await feedbackHandler(null, {
|
||||
...e.detail
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user