1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2025-01-10 00:30:09 +00:00

Adding options-object for insertText

This commit is contained in:
Tim Düsterhus 2011-12-12 16:16:24 +01:00
parent 1d8b96aefc
commit c7d867905f

View File

@ -114,10 +114,18 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
}
$('.chatMessageContainer').animate({scrollTop: $('.chatMessageContainer ul').height()}, 10000);
},
insertText: function (text) {
// TODO: Add options here
var input = $('#chatInput');
input.val(input.val() + ' ' + text + ' ');
insertText: function (text, options) {
options = $.extend({
append: true,
submit: false
}, options || {});
if (options.append) {
text = $('#chatInput').val() + text;
}
$('#chatInput').val(text);
if (options.submit) $('#chatForm').submit();
},
toggleUserMenu: function (target) {
liUserID = '#' + target.parent().parent().attr('id');