From 6a68e560a59012a92abd680b527cca2f01a1b1ad Mon Sep 17 00:00:00 2001 From: WASRUSGEN Date: Fri, 29 May 2026 20:10:27 +0300 Subject: [PATCH] fix: merge upload button into Elena response bubble, no duplicate message --- mockup.html | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/mockup.html b/mockup.html index 2e7be24..0742af8 100644 --- a/mockup.html +++ b/mockup.html @@ -4228,31 +4228,20 @@ function elenaIntent(intent) { : 'Хорошо, посмотрю. Если у вас есть текст договора — загрузите или вставьте, найду все риски и объясню понятно.'; var replyText = apiReply || defaultReply; - // Добавляем ответ Елены + // Добавляем ответ Елены — кнопка загрузки встроена в пузырь если нужна + var hasContract = ((document.getElementById('el-paste') || {}).value || '').length > 50; + var uploadBtn = (intent === 'check' && !hasContract) + ? '
' + + '
' + : ''; var mb = document.createElement('div'); mb.className = 'msg'; mb.innerHTML = '
' - + '
Елена
' + replyText + '
'; + + '
Елена
' + replyText + uploadBtn + '
'; wrap.appendChild(mb); - - // Предлагаем загрузить только если intent=check И договора ещё нет - var hasContract = ((document.getElementById('el-paste') || {}).value || '').length > 50; - if (intent === 'check' && !hasContract) { - setTimeout(function() { - var ob = document.createElement('div'); - ob.className = 'msg'; - ob.innerHTML = '
' - + '
Елена
' - + 'Если у вас есть текст договора — загрузите, разберу детально.' - + '
' - + '' - + '
'; - wrap.appendChild(ob); - ob.scrollIntoView({behavior:'smooth'}); - }, 800); - } + mb.scrollIntoView({behavior:'smooth'}); }); }