g
This commit is contained in:
@@ -25,17 +25,31 @@ class DemoChat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
// Get demo chat elements
|
// Get demo chat elements - try multiple selectors for compatibility
|
||||||
this.chatMessages = document.querySelector('.chat-demo .chat-messages');
|
this.chatMessages = document.querySelector('.chat-demo .chat-messages')
|
||||||
this.chatInput = document.querySelector('.chat-demo .chat-input-field');
|
|| document.querySelector('.chat-demo .chat-preview .chat-messages');
|
||||||
this.sendBtn = document.querySelector('.chat-demo .chat-send-btn');
|
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) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bindEvents();
|
this.bindEvents();
|
||||||
|
console.log('Demo Chat: Events bound successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
generateSessionId() {
|
generateSessionId() {
|
||||||
|
|||||||
Reference in New Issue
Block a user