|
|
|
@ -23,7 +23,7 @@
@@ -23,7 +23,7 @@
|
|
|
|
|
define(['underscore', 'angular', 'text!partials/roombar.html'], function(_, angular, template) { |
|
|
|
|
|
|
|
|
|
// roomBar
|
|
|
|
|
return ["$window", "rooms", "$timeout", function($window, rooms, $timeout) { |
|
|
|
|
return ["$window", "rooms", "$timeout", "safeApply", function($window, rooms, $timeout, safeApply) { |
|
|
|
|
|
|
|
|
|
var link = function($scope, $element) { |
|
|
|
|
|
|
|
|
@ -51,13 +51,17 @@ define(['underscore', 'angular', 'text!partials/roombar.html'], function(_, angu
@@ -51,13 +51,17 @@ define(['underscore', 'angular', 'text!partials/roombar.html'], function(_, angu
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$scope.$on("room.updated", function(ev, room) { |
|
|
|
|
$scope.currentRoomName = $scope.newRoomName = room.Name; |
|
|
|
|
if ($scope.currentRoomName && !$scope.peer) { |
|
|
|
|
$scope.layout.roombar = true; |
|
|
|
|
} |
|
|
|
|
safeApply($scope, function(scope) { |
|
|
|
|
scope.currentRoomName = scope.newRoomName = room.Name; |
|
|
|
|
if (scope.currentRoomName && !scope.peer) { |
|
|
|
|
scope.layout.roombar = true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$on("room.left", clearRoomName); |
|
|
|
|
$scope.$on("room.left", function() { |
|
|
|
|
safeApply($scope, clearRoomName); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$watch("newRoomName", function(name) { |
|
|
|
|
if (name === $scope.currentRoomName) { |
|
|
|
|