fbe4f82517
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>
33 lines
1.1 KiB
JavaScript
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);
|
|
},
|
|
});
|
|
});
|