Browse Source

Hide buddy list when not in a room.

Signed-off-by: Simon Eisenmann <simon@struktur.de>
pull/3/head
Simon Eisenmann 12 years ago committed by Simon Eisenmann
parent
commit
67bcaf0f4b
  1. 2
      src/styles/components/_buddylist.scss
  2. 4
      static/js/directives/buddylist.js
  3. 2
      static/partials/buddylist.html

2
src/styles/components/_buddylist.scss

@ -24,7 +24,6 @@ top: 44px; @@ -24,7 +24,6 @@ top: 44px;
right: 0px;
bottom: 0px;
width:260px;
border-top: 1px solid $bordercolor;
z-index:5;
pointer-events:none;
}
@ -36,6 +35,7 @@ top:0px; @@ -36,6 +35,7 @@ top:0px;
bottom:0px;
overflow-x: hidden;
overflow-y: auto;
border-top: 1px solid $bordercolor;
}
.buddylist .buddycontainer {
-webkit-user-select: none;

4
static/js/directives/buddylist.js

@ -28,6 +28,7 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) { @@ -28,6 +28,7 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) {
var controller = ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
//console.log("BuddylistController", $buddylist, $element, $scope);
$scope.enabled = false;
$scope.doCall = function(id) {
@ -63,17 +64,20 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) { @@ -63,17 +64,20 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) {
}
});
mediaStream.api.e.on("received.users", function(event, data) {
$scope.enabled = true;
var selfId = $scope.id;
_.each(data, function(p) {
if (p.Id !== selfId) {
onJoined(p);
}
});
$scope.$apply();
});
mediaStream.api.e.on("received.status", function(event, data) {
onStatus(data);
});
mediaStream.connector.e.on("closed error", function() {
$scope.enabled = false;
buddylist.onClosed();
});

2
static/partials/buddylist.html

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<div class="buddylist nicescroll" ng-class="{loading: loading, empty: empty}">
<div class="buddylist nicescroll" ng-show="enabled" ng-class="{loading: loading, empty: empty}">
<div class="buddycontainer">
<div>
</div>

Loading…
Cancel
Save