This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
SmartAssistant/files/client/custom/modules/smart-assistant/src/views/site/navbar.js
T
chaim fbe4f82517 refactor: migrate client paths to EspoCRM module format
Move JS from client/custom/src/modules/{mod}/ to client/custom/modules/{mod}/src/
Move TPL to client/custom/modules/{mod}/res/templates/
Update all define(), createView(), and metadata references from
custom:modules/{mod}/... to modules/{mod}/...

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:51:55 +00:00

33 lines
1.1 KiB
JavaScript

define('modules/smart-assistant/views/site/navbar', ['views/site/navbar'], function (NavbarView) {
return NavbarView.extend({
afterRender: function () {
NavbarView.prototype.afterRender.call(this);
this._initFloatingChat();
},
_initFloatingChat: function () {
if (this._floatingChatInitialized) return;
this._floatingChatInitialized = true;
var $container = $('body > .smart-assistant-fab-container');
if ($container.length === 0) {
$container = $('<div class="smart-assistant-fab-container"></div>');
$('body').append($container);
}
this.createView('floatingChat', 'modules/smart-assistant/views/floating-chat', {
el: '.smart-assistant-fab-container',
}, function (view) {
view.render();
});
},
onRemove: function () {
$('body > .smart-assistant-fab-container').remove();
NavbarView.prototype.onRemove.call(this);
},
});
});