Browse Source

Added filter to avoid empty displayNames in additional sesions list.

pull/100/head
Simon Eisenmann 11 years ago
parent
commit
61210a09d5
  1. 35
      static/js/filters/displaynameforsession.js
  2. 6
      static/js/filters/filters.js
  3. 2
      static/partials/buddyactions.html

35
static/js/filters/displaynameforsession.js

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
/*
* Spreed WebRTC.
* Copyright (C) 2013-2014 struktur AG
*
* This file is part of Spreed WebRTC.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(["jquery"], function($) {
// displayNameForSession
return ["$filter", function($filter) {
return function(displayName, id) {
if ($.trim(displayName) !== "") {
return displayName;
}
return $filter("displayName")(id)
};
}];
});

6
static/js/filters/filters.js

@ -24,13 +24,15 @@ define([ @@ -24,13 +24,15 @@ define([
'filters/displayname',
'filters/buddyimagesrc',
'filters/displayconference',
'filters/displayuserid'], function(_, displayName, buddyImageSrc, displayConference, displayUserid) {
'filters/displayuserid',
'filters/displaynameforsession'], function(_, displayName, buddyImageSrc, displayConference, displayUserid, displayNameForSession) {
var filters = {
displayName: displayName,
buddyImageSrc: buddyImageSrc,
displayConference: displayConference,
displayUserid: displayUserid
displayUserid: displayUserid,
displayNameForSession: displayNameForSession
};
var initialize = function(angModule) {

2
static/partials/buddyactions.html

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<li ng-repeat="(id, s) in session.sessions" ng-class="{currentsession: s.Id === session.Id}">
<span>
<div class="buddyPicture buddyPictureSmall"><i class="fa fa-user"/><img ng-show="s.Status.buddyPicture" alt ng-src="{{s.Id|buddyImageSrc:s.Status}}"/></div>
<div class="buddy3" title="{{s.Status.message}}">{{s.Status.displayName}}<span ng-show="s.Status.message">, {{s.Status.message}}</span></div>
<div class="buddy3" title="{{s.Status.message}}">{{s.Status.displayName|displayNameForSession:s.Id}}<span ng-show="s.Status.message">, {{s.Status.message}}</span></div>
<div class="btn-group">
<a class="btn btn-sm btn-primary" title="{{_('Start video call')}}" ng-click="doCall(s.Id); $event.stopPropagation()"><i class="fa fa-phone"></i></a>
<a class="btn btn-sm btn-primary" title="{{_('Start chat')}}" ng-click="doChat(s.Id); $event.stopPropagation()"><i class="fa fa-comments-o"></i></a>

Loading…
Cancel
Save