From 67bcaf0f4bf2fe6dc1eb0ee296ecdc94e07ac8ec Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Sat, 1 Mar 2014 12:09:28 +0100 Subject: [PATCH] Hide buddy list when not in a room. Signed-off-by: Simon Eisenmann --- src/styles/components/_buddylist.scss | 2 +- static/js/directives/buddylist.js | 4 ++++ static/partials/buddylist.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/styles/components/_buddylist.scss b/src/styles/components/_buddylist.scss index cbd7b320..a4e6bea5 100644 --- a/src/styles/components/_buddylist.scss +++ b/src/styles/components/_buddylist.scss @@ -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; bottom:0px; overflow-x: hidden; overflow-y: auto; +border-top: 1px solid $bordercolor; } .buddylist .buddycontainer { -webkit-user-select: none; diff --git a/static/js/directives/buddylist.js b/static/js/directives/buddylist.js index 18c8e2c4..0de5f3bd 100644 --- a/static/js/directives/buddylist.js +++ b/static/js/directives/buddylist.js @@ -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) { } }); 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(); }); diff --git a/static/partials/buddylist.html b/static/partials/buddylist.html index 06cc7364..f0f406ed 100644 --- a/static/partials/buddylist.html +++ b/static/partials/buddylist.html @@ -1,4 +1,4 @@ -
+