Fix tooltips for chatbot

This commit is contained in:
Alexey Koshelev
2025-04-16 14:59:34 +03:00
parent 98293c787f
commit f12c5458ea

View File

@ -101,7 +101,7 @@
$messageContent.append($error);
} else {
let $actionButtons = $('<div class="action_buttons_list"></div>');
actionButtons.forEach(function(button) {
actionButtons.forEach(function(button, index) {
let buttonEl = $('<button class="action_button btn-text-default"></button>');
buttonEl.append('<img class="icon" src="' + getFormattedPathForIcon(button.icon) + '"/>');
buttonEl.on('click', function() {
@ -109,7 +109,10 @@
});
if(button.tipOptions) {
new Tooltip(buttonEl[0], button.tipOptions);
if(item.btnTips[index]) {
item.btnTips[index]._deleteTooltipElement();
}
item.btnTips[index] = new Tooltip(buttonEl[0], button.tipOptions);
}
$actionButtons.append(buttonEl);
@ -169,6 +172,7 @@
if(message.role == 'assistant') {
message.activeContentIndex = 0;
}
message.btnTips = [];
this._list.push(message)
this._renderItemToList(message, this._list.length - 1);
},