This commit is contained in:
2026-02-19 11:56:20 +01:00
parent 581e726f78
commit b1c67f31c4

View File

@@ -25,17 +25,31 @@ class DemoChat {
}
setup() {
// Get demo chat elements
this.chatMessages = document.querySelector('.chat-demo .chat-messages');
this.chatInput = document.querySelector('.chat-demo .chat-input-field');
this.sendBtn = document.querySelector('.chat-demo .chat-send-btn');
// Get demo chat elements - try multiple selectors for compatibility
this.chatMessages = document.querySelector('.chat-demo .chat-messages')
|| document.querySelector('.chat-demo .chat-preview .chat-messages');
this.chatInput = document.querySelector('.chat-demo .chat-input-field')
|| document.querySelector('.chat-demo input[type="text"]');
this.sendBtn = document.querySelector('.chat-demo .chat-send-btn')
|| document.querySelector('.chat-demo button');
console.log('Demo Chat Setup:', {
messagesFound: !!this.chatMessages,
inputFound: !!this.chatInput,
sendBtnFound: !!this.sendBtn
});
if (!this.chatMessages || !this.chatInput || !this.sendBtn) {
console.warn('Demo chat elements not found');
console.warn('Demo chat elements not found', {
chatMessages: this.chatMessages,
chatInput: this.chatInput,
sendBtn: this.sendBtn
});
return;
}
this.bindEvents();
console.log('Demo Chat: Events bound successfully');
}
generateSessionId() {