Skip to content

Commit 768e08d

Browse files
committed
Update variable names and positioning.
1 parent 8b03418 commit 768e08d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

static/js/directives/chat.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
193193
var options = $.extend({}, opts);
194194
var subscope = controller.rooms[id];
195195
var index = controller.visibleRooms.length;
196-
var buddy = buddyData.lookup(id);
197196
if (!subscope) {
198197
console.log("Create new chatroom", [id]);
198+
var buddy = buddyData.lookup(id);
199199
if (settings.group) {
200200
controller.visibleRooms.unshift(id);
201201
} else {
@@ -215,9 +215,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
215215
subscope.p2pstate = false;
216216
subscope.active = false;
217217
subscope.pending = 0;
218-
subscope.isuser = !!(buddy && buddy.session && buddy.session.Userid);
219-
subscope.iscontact = !!(buddy && buddy.contact);
220-
subscope.canAddContact = !subscope.isgroupchat && subscope.isuser;
218+
subscope.isUser = !!(buddy && buddy.session && buddy.session.Userid);
219+
subscope.isContact = !!(buddy && buddy.contact);
220+
subscope.canAddContact = !subscope.isgroupchat && subscope.isUser;
221221
if (!subscope.isgroupchat) {
222222
buddyData.push(id);
223223
}
@@ -341,7 +341,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
341341
contacts.remove(buddy.contact.Userid);
342342
};
343343
subscope.updateContactStatus = function(event, data) {
344-
subscope.iscontact = event.type === "contactadded";
344+
subscope.isContact = event.type === "contactadded";
345345
};
346346
contacts.e.on("contactadded", subscope.updateContactStatus);
347347
contacts.e.on("contactremoved", subscope.updateContactStatus);

static/partials/chatroom.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<button ng-if="!isgroupchat" class="btn btn-sm btn-primary" title="{{_('Start video call')}}" ng-click="doCall()"><i class="fa fa-phone fa-fw"></i></button>
66
<button class="btn btn-sm btn-primary btn-fileupload" title="{{_('Upload files')}}"><i class="fa fa-upload fa-fw"></i></button>
77
<button class="btn btn-sm btn-primary" title="{{_('Share my location')}}" ng-click="shareGeolocation()"><i class="fa fa-location-arrow fa-fw"></i></button>
8-
<button ng-if="canAddContact && !iscontact" class="btn btn-sm btn-primary" title="{{_('Add to contacts')}}" ng-click="addContact()"><i class="fa fa-star-o"></i></button>
9-
<button ng-if="canAddContact && iscontact" class="btn btn-sm btn-primary" title="{{_('Remove from contacts')}}" ng-click="removeContact()"><i class="fa fa-star"></i></button>
8+
<button ng-if="canAddContact && !isContact" class="btn btn-sm btn-primary" title="{{_('Add to contacts')}}" ng-click="addContact()"><i class="fa fa-star-o"></i></button>
9+
<button ng-if="canAddContact && isContact" class="btn btn-sm btn-primary" title="{{_('Remove from contacts')}}" ng-click="removeContact()"><i class="fa fa-star"></i></button>
1010
</div>
1111
<div class="btn-group pull-right">
1212
<button class="btn btn-sm btn-default" title="{{_('Clear chat')}}" ng-click="doClear()"><i class="fa fa-eraser fa-fw"></i></button>

0 commit comments

Comments
 (0)