Commit 141eaa6a authored by JC Brand's avatar JC Brand

Fix rendering of heading for headlines boxes

parent 9aefd273
......@@ -274,9 +274,6 @@
this.model.on('showHelpMessages', this.showHelpMessages, this);
this.model.on('sendMessage', this.sendMessage, this);
this.heading = new _converse.ChatBoxHeading({'model': this.model});
this.heading.render();
this.heading.chatview = this;
this.render().renderToolbar().insertHeading().fetchMessages();
utils.refreshWebkit();
......@@ -288,20 +285,24 @@
this.el.setAttribute('id', this.model.get('box_id'));
this.el.innerHTML = tpl_chatbox(
_.extend(this.model.toJSON(), {
show_toolbar: _converse.show_toolbar,
show_textarea: true,
show_send_button: _converse.show_send_button,
unread_msgs: __('You have unread messages'),
label_personal_message: __('Personal message'),
label_send: __('Send')
label_send: __('Send'),
show_avatar: true,
show_send_button: _converse.show_send_button,
show_textarea: true,
show_toolbar: _converse.show_toolbar,
unread_msgs: __('You have unread messages')
}
)
);
));
this.$content = this.$el.find('.chat-content');
return this;
},
insertHeading () {
this.heading = new _converse.ChatBoxHeading({'model': this.model});
this.heading.render();
this.heading.chatview = this;
const flyout = this.el.querySelector('.flyout');
flyout.insertBefore(this.heading.el, flyout.querySelector('.chat-body'));
return this;
......
......@@ -62,27 +62,26 @@
this.model.on('show', this.show, this);
this.model.on('destroy', this.hide, this);
this.model.on('change:minimized', this.onMinimizedChanged, this);
this.render().fetchMessages().insertIntoDOM().hide();
this.render().insertHeading().fetchMessages().insertIntoDOM().hide();
_converse.emit('chatBoxOpened', this);
_converse.emit('chatBoxInitialized', this);
},
render () {
this.$el.attr('id', this.model.get('box_id'))
.html(tpl_chatbox(
_.extend(this.model.toJSON(), {
show_toolbar: _converse.show_toolbar,
show_textarea: false,
show_send_button: _converse.show_send_button,
title: this.model.get('fullname'),
unread_msgs: __('You have unread messages'),
info_close: __('Close this box'),
label_personal_message: ''
}
)
)
);
this.el.innerHTML = tpl_chatbox(
_.extend(this.model.toJSON(), {
info_close: '',
label_personal_message: '',
show_avatar: false,
show_send_button: false,
show_textarea: false,
show_toolbar: false,
unread_msgs: ''
}
));
this.$content = this.$el.find('.chat-content');
_converse.emit('chatBoxOpened', this);
utils.refreshWebkit();
return this;
}
......
<div class="chat-head chat-head-chatbox">
<a class="chatbox-btn close-chatbox-button icon-close" title="{{{o.info_close}}}"></a>
{[ if (o.show_avatar) { ]}
<img alt="User Avatar"
class="avatar"
height="{{{o.avatar_height}}}px" width="{{{o.avatar_width}}}px"
src="data:{{{o.image_type}}};base64,{{{o.image}}}"/>
{[ } ]}
<div class="chat-title">
{[ if (o.url) { ]}
<a href="{{{o.url}}}" target="_blank" rel="noopener" class="user">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment