Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions eStreamChat/Scripts/eStreamChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ $(function () {
}

// Set default active tab
if (!messengerMode)
if (!messengerMode) {
activePanel = $('#panel-room');
else {
$('#panel-room').attr('id', 'panel-' + messengerTargetUserId);
activePanel = $('#panel-' + messengerTargetUserId);
} else {
// replace non-alphanumeric characters in the userid
$('#panel-room').attr('id', 'panel-' + messengerTargetUserId.replace(/[^\w]/g, '_'));
activePanel = $('#panel-' + messengerTargetUserId.replace(/[^\w]/g, '_'));
}

// Prepare the text formatting buttons
Expand Down Expand Up @@ -881,10 +882,12 @@ function getPanelForMessage(message) {
}

function getPanelByUserId(userId) {
if (userId == null)
if (userId == null) {
return $('#panel-room');
else
return $('#panel-' + userId);
} else {
// replace non-alphanumeric characters in the userid
return $('#panel-' + userId.replace(/[^\w]/g, '_'));
}
}

$.fn.setCursorPosition = function(pos) {
Expand Down