start: function () { var self = this; this.$attachment_button = this.$(".o_composer_button_add_attachment"); this.$attachments_list = this.$('.o_composer_attachments_list'); this.$input = this.$('.o_composer_input textarea'); this.$input.focus(function () { self.trigger('input_focused'); }); this.$input.val(this.options.default_body); dom_utils.autoresize(this.$input, {parent: this, min_height: this.options.input_min_height}); // Attachments $(window).on(this.fileupload_id, this.on_attachment_loaded); this.on("change:attachment_ids", this, this.render_attachments); // Emoji this.$('.o_composer_button_emoji').popover({ placement: 'top', content: function() { if (!self.$emojis) { // lazy rendering self.$emojis = $(QWeb.render('mail.ChatComposer.emojis', { emojis: chat_manager.get_emojis(), })); self.$emojis.filter('.o_mail_emoji').on('click', self, self.on_click_emoji_img); } return self.$emojis; }, html: true, container: '.' + self.emoji_container_classname, trigger: 'focus', }); // Mention this.mention_manager.prependTo(this.$('.o_composer')); return this._super(); },
this.$('textarea').each(function () { dom_utils.autoresize($(this), {parent: self}); });