1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Use inArray helper instead of the jQuery direct function. Coding style

This commit is contained in:
Loic Blot 2015-06-08 19:26:12 +00:00
parent 8680ce6d38
commit 68114429c0

View File

@ -133,7 +133,8 @@ var checkNewMessages = function() {
if (typeof jsondata['photos'][peerLabel] != 'undefined') {
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';
}
peerListBuf += '></div><a href="#" ng-click="loadConversation(' + idxVal2 + ');" mailbox-navigation="' + idxVal2 + '" style="font-weight: bold;" mailbox-label="' + peerLabel + '">' + peerLabel + ' (' + val + ')</a></li>';
peerListBuf += '></div><a href="#" ng-click="loadConversation(' + idxVal2 + ');" mailbox-navigation="' +
idxVal2 + '" style="font-weight: bold;" mailbox-label="' + peerLabel + '">' + peerLabel + ' (' + val + ')</a></li>';
$('#app-mailbox-peers ul').prepend(peerListBuf);
bufferedContacts.push(peerLabel);
@ -329,7 +330,7 @@ function fetchInitialPeerList(jsondata) {
fn = jsondata['contacts'][id];
peerLabel = fn;
}
if ($.inArray(peerLabel, bufferedContacts) == -1) {
if (inArray(peerLabel, bufferedContacts)) {
aScope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': jsondata['photos'][peerLabel]});
bufferedContacts.push(peerLabel);
}