Update chat_window.php
This commit is contained in:
+15
-4
@@ -1030,10 +1030,9 @@ if (empty($user_id)) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mostrar contenedor solo si hay respuestas
|
// No mostrar automáticamente el contenedor al cargar la conversación.
|
||||||
if (container.children.length) {
|
// Dejamos que el usuario lo abra con el botón toggle. Si no hay respuestas, mantener oculto.
|
||||||
wrapper.style.display = 'block';
|
if (!container.children.length) {
|
||||||
} else {
|
|
||||||
wrapper.style.display = 'none';
|
wrapper.style.display = 'none';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1046,8 +1045,20 @@ if (empty($user_id)) {
|
|||||||
|
|
||||||
function toggleQuickReplies() {
|
function toggleQuickReplies() {
|
||||||
const wrapper = document.getElementById('quickRepliesContainer');
|
const wrapper = document.getElementById('quickRepliesContainer');
|
||||||
|
const container = document.getElementById('quickRepliesButtons');
|
||||||
if (!wrapper) return;
|
if (!wrapper) return;
|
||||||
|
|
||||||
|
// Si no hay botones cargados, intentar cargarlos y luego mostrar
|
||||||
|
if (container && container.children.length === 0) {
|
||||||
|
loadQuickReplies().then(() => {
|
||||||
wrapper.style.display = (wrapper.style.display === 'block') ? 'none' : 'block';
|
wrapper.style.display = (wrapper.style.display === 'block') ? 'none' : 'block';
|
||||||
|
}).catch(() => {
|
||||||
|
// on error, mantener oculto
|
||||||
|
wrapper.style.display = 'none';
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
wrapper.style.display = (wrapper.style.display === 'block') ? 'none' : 'block';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showError(message) {
|
function showError(message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user