Browse Source

Never hide roombar completely.

pull/156/merge
Simon Eisenmann 11 years ago
parent
commit
21f308500d
  1. 1
      static/js/directives/page.js
  2. 11
      static/js/directives/roombar.js
  3. 2
      static/partials/roombar.html

1
static/js/directives/page.js

@ -33,6 +33,7 @@ define(['text!partials/page.html', 'text!partials/page/welcome.html'], function( @@ -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";
});

11
static/js/directives/roombar.js

@ -23,7 +23,7 @@ @@ -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 @@ -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 @@ -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 @@ -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) {

2
static/partials/roombar.html

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<div class="roombar overlaybar form-horizontal" ng-hide="currentRoomName===null" ng-class="{notvisible: !layout.roombar}">
<div class="roombar overlaybar form-horizontal" ng-class="{notvisible: !layout.roombar}">
<a class="overlaybar-button" ng-model="layout.roombar" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false" title="{{_('Change room')}}"><i class="fa fa-pencil-square-o"></i></a>
<form name="roombarform" class="overlaybar-content form-group">
<label class="pull-left control-label hidden-xs">{{_('Room')}}</label>

Loading…
Cancel
Save