Skip to content

Commit c601448

Browse files
committed
Update variable names and positioning.
1 parent 07835e5 commit c601448

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

static/js/directives/chat.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
195195
var options = $.extend({}, opts);
196196
var subscope = controller.rooms[id];
197197
var index = controller.visibleRooms.length;
198-
var buddy = buddyData.lookup(id);
199198
if (!subscope) {
200199
console.log("Create new chatroom", [id]);
200+
var buddy = buddyData.lookup(id);
201201
if (settings.group) {
202202
controller.visibleRooms.unshift(id);
203203
} else {
@@ -217,9 +217,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
217217
subscope.p2pstate = false;
218218
subscope.active = false;
219219
subscope.pending = 0;
220-
subscope.isuser = !!(buddy && buddy.session && buddy.session.Userid);
221-
subscope.iscontact = !!(buddy && buddy.contact);
222-
subscope.canAddContact = !subscope.isgroupchat && subscope.isuser;
220+
subscope.isUser = !!(buddy && buddy.session && buddy.session.Userid);
221+
subscope.isContact = !!(buddy && buddy.contact);
222+
subscope.canAddContact = !subscope.isgroupchat && subscope.isUser;
223223
if (!subscope.isgroupchat) {
224224
buddyData.push(id);
225225
}
@@ -345,7 +345,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
345345
contacts.remove(buddy.contact.Userid);
346346
};
347347
subscope.updateContactStatus = function(event, data) {
348-
subscope.iscontact = event.type === "contactadded";
348+
subscope.isContact = event.type === "contactadded";
349349
};
350350
contacts.e.on("contactadded", subscope.updateContactStatus);
351351
contacts.e.on("contactremoved", subscope.updateContactStatus);

static/partials/chatroom.html

+2-2
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 btn-locationshare" 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)