fix(mobile): optimize mobile UI/UX for UdeCi chatbot and dashboard (v3.8.30)
This commit is contained in:
@@ -204,6 +204,8 @@
|
||||
if (panel && launcher) {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
launcher.classList.remove('chat-open');
|
||||
document.body.classList.remove('ai-chat-mobile-open');
|
||||
}
|
||||
setTimeout(() => {
|
||||
window.WalkthroughEngine.startStep(data.guide_step);
|
||||
@@ -236,28 +238,45 @@
|
||||
const role = getUserRole();
|
||||
const name = getUserName();
|
||||
|
||||
function openChat() {
|
||||
panel.classList.remove('d-none');
|
||||
launcher.style.transform = 'scale(0.9)';
|
||||
launcher.classList.add('chat-open');
|
||||
if (window.innerWidth <= 768) {
|
||||
document.body.classList.add('ai-chat-mobile-open');
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (textarea) textarea.focus();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function closeChat() {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
launcher.classList.remove('chat-open');
|
||||
document.body.classList.remove('ai-chat-mobile-open');
|
||||
}
|
||||
|
||||
// Toggle panel
|
||||
launcher.addEventListener('click', () => {
|
||||
const isHidden = panel.classList.contains('d-none');
|
||||
if (isHidden) {
|
||||
panel.classList.remove('d-none');
|
||||
launcher.style.transform = 'scale(0.9)';
|
||||
setTimeout(() => {
|
||||
if (textarea) textarea.focus();
|
||||
}, 100);
|
||||
openChat();
|
||||
} else {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
closeChat();
|
||||
}
|
||||
});
|
||||
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener('click', () => {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
});
|
||||
closeBtn.addEventListener('click', closeChat);
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape' && panel && !panel.classList.contains('d-none')) {
|
||||
closeChat();
|
||||
}
|
||||
});
|
||||
|
||||
// Reiniciar conversación del usuario actual
|
||||
if (clearBtn) {
|
||||
clearBtn.addEventListener('click', () => {
|
||||
|
||||
Reference in New Issue
Block a user