diff --git a/static/js/directives/page.js b/static/js/directives/page.js index 791a2833..fd279d70 100644 --- a/static/js/directives/page.js +++ b/static/js/directives/page.js @@ -33,6 +33,7 @@ define(['text!partials/page.html', 'text!partials/page/welcome.html'], function( }); $scope.$on("room.random", function(ev, roomdata) { // Show welcome page on room random events. + $scope.layout.roombar = false; $timeout(function() { $scope.page = "page/welcome.html"; }); diff --git a/static/js/directives/roombar.js b/static/js/directives/roombar.js index d3777d0f..2d58e9fc 100644 --- a/static/js/directives/roombar.js +++ b/static/js/directives/roombar.js @@ -23,7 +23,7 @@ define(['underscore', 'angular', 'text!partials/roombar.html'], function(_, angular, template) { // roomBar - return ["$window", "rooms", function($window, rooms) { + return ["$window", "rooms", "$timeout", function($window, rooms, $timeout) { var link = function($scope, $element) { @@ -33,7 +33,7 @@ define(['underscore', 'angular', 'text!partials/roombar.html'], function(_, angu }; //console.log("roomBar directive link", arguments); - $scope.layout.roombar = true; + //$scope.layout.roombar = true; $scope.save = function() { if ($scope.roombarform.$invalid) { @@ -52,6 +52,9 @@ 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.layout.roombar = true; + } }); $scope.$on("room.left", clearRoomName); @@ -63,7 +66,9 @@ define(['underscore', 'angular', 'text!partials/roombar.html'], function(_, angu }); $scope.$watch("layout.roombar", function(value) { - $element.find("input").focus(); + $timeout(function() { + $element.find("input").focus(); + }); }); $scope.$watch("peer", function(peer) { diff --git a/static/partials/roombar.html b/static/partials/roombar.html index ed0a4056..14dbdb91 100644 --- a/static/partials/roombar.html +++ b/static/partials/roombar.html @@ -1,4 +1,4 @@ -
+