Render help messages via templates.
This commit is contained in:
parent
6af4480c14
commit
0bab19fafd
@ -133,6 +133,7 @@ require.config({
|
||||
"form_textarea": "src/templates/form_textarea",
|
||||
"form_username": "src/templates/form_username",
|
||||
"group_header": "src/templates/group_header",
|
||||
"help_message": "src/templates/help_message",
|
||||
"info": "src/templates/info",
|
||||
"login_panel": "src/templates/login_panel",
|
||||
"login_tab": "src/templates/login_tab",
|
||||
|
@ -13,6 +13,7 @@
|
||||
"tpl!new_day",
|
||||
"tpl!action",
|
||||
"tpl!message",
|
||||
"tpl!help_message",
|
||||
"tpl!toolbar",
|
||||
"tpl!avatar"
|
||||
], factory);
|
||||
@ -22,6 +23,7 @@
|
||||
tpl_new_day,
|
||||
tpl_action,
|
||||
tpl_message,
|
||||
tpl_help_message,
|
||||
tpl_toolbar,
|
||||
tpl_avatar
|
||||
) {
|
||||
@ -369,7 +371,10 @@
|
||||
showHelpMessages: function (msgs, type, spinner) {
|
||||
var i, msgs_length = msgs.length;
|
||||
for (i=0; i<msgs_length; i++) {
|
||||
this.$content.append($('<div class="chat-'+(type||'info')+'">'+msgs[i]+'</div>'));
|
||||
this.$content.append($(tpl_help_message({
|
||||
'type': type||'info',
|
||||
'message': msgs[i]
|
||||
})));
|
||||
}
|
||||
if (spinner === true) {
|
||||
this.$content.append('<span class="spinner"/>');
|
||||
|
1
src/templates/help_message.html
Normal file
1
src/templates/help_message.html
Normal file
@ -0,0 +1 @@
|
||||
<div class="chat-{{{type}}}">{{{message}}}</div>
|
Loading…
Reference in New Issue
Block a user