Browse Source

Expose authorizing flag in scope and hide sign-in button when true.

pull/195/head
Simon Eisenmann 10 years ago
parent
commit
0a3f2cb879
  1. 5
      static/js/controllers/appcontroller.js
  2. 2
      static/partials/statusmessage.html

5
static/js/controllers/appcontroller.js

@ -33,6 +33,7 @@ define(["jquery", "angular", "underscore"], function($, angular, _) { @@ -33,6 +33,7 @@ define(["jquery", "angular", "underscore"], function($, angular, _) {
appData.set($scope);
// User related scope data.
$scope.authorizing = false;
$scope.roomsHistory = [];
$scope.defaults = {
displayName: null,
@ -110,6 +111,10 @@ define(["jquery", "angular", "underscore"], function($, angular, _) { @@ -110,6 +111,10 @@ define(["jquery", "angular", "underscore"], function($, angular, _) {
}
});
appData.e.on("authorizing", function(event, authorizing) {
$scope.authorizing = !!authorizing;
});
$scope.reset(); // Call once for bootstrap.
}];

2
static/partials/statusmessage.html

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<span class="status-{{status}}" ng-switch on="status">
<span ng-switch-when="initializing">{{_("Initializing")}} <i class="fa fa-circle-o-notch fa-spin"></i></span>
<span ng-switch-when="waiting" ng-controller="UsersettingsController as usersettings"><span class="status-indicator"><i style="color:rgb(132,184,25)" class="fa fa-dot-circle-o" title="{{_('Online')}}"></i> {{id|displayName}}</span> <img class="userpicture" ng-show="master.buddyPicture" ng-src="{{master.buddyPicture}}" alt="" /><button ng-if="!myuserid && usersettings.loginUserid" type="button" class="btn btn-default" ng-click="usersettings.loginUserid()">{{_("Sign in")}}</button></span>
<span ng-switch-when="waiting" ng-controller="UsersettingsController as usersettings"><span class="status-indicator"><i style="color:rgb(132,184,25)" class="fa fa-dot-circle-o" title="{{_('Online')}}"></i> {{id|displayName}}</span> <img class="userpicture" ng-show="master.buddyPicture" ng-src="{{master.buddyPicture}}" alt="" /><button ng-if="!authorizing && !myuserid && usersettings.loginUserid" type="button" class="btn btn-default" ng-click="usersettings.loginUserid()">{{_("Sign in")}}</button></span>
<span ng-switch-when="connecting"><span class="msg">{{_("Calling")}} {{dialing|displayName}}</span> <a class="btn btn-small btn-danger" ng-click="doAbort()"><i class="fa fa-circle-o-notch fa-spin"></i> {{_("Hangup")}}</a></span>
<span ng-switch-when="connected"><span class="msg">{{_("In call with")}} {{peer|displayName}}</span> <a class="btn btn-small btn-danger" ng-click="doHangup()"><i class="fa fa-sign-out"></i> {{_("Hangup")}}</a></span>
<span ng-switch-when="conference"><span class="msg">{{_("Conference with")}} {{peer|displayName}}<span>{{conferencePeers|displayConference}}</span></span> <a class="btn btn-small btn-danger" ng-click="doHangup()"><i class="fa fa-sign-out"></i> {{_("Hangup")}}</a></span>

Loading…
Cancel
Save