зеркало из https://github.com/nextcloud/spreed.git
Correctly handle online/offline
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
8a6be157a4
Коммит
5fe5872995
|
@ -33,6 +33,10 @@
|
|||
sessionId: '',
|
||||
participantType: 4,
|
||||
lastPing: 0
|
||||
},
|
||||
|
||||
isOnline: function() {
|
||||
return this.get('lastPing') >= moment().format('X') - 60;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -27,10 +27,6 @@
|
|||
OCA.SpreedMe.Models = OCA.SpreedMe.Models || {};
|
||||
|
||||
OCA.SpreedMe.Models.ParticipantCollection = Backbone.Collection.extend({
|
||||
initialize: function() {
|
||||
console.log("initialize");
|
||||
console.log(arguments);
|
||||
},
|
||||
model: OCA.SpreedMe.Models.Participant,
|
||||
room: undefined,
|
||||
|
||||
|
@ -50,7 +46,6 @@
|
|||
* @returns {Array}
|
||||
*/
|
||||
parse: function(result) {
|
||||
console.log(result);
|
||||
return result.ocs.data;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
var uiChannel = Backbone.Radio.channel('ui');
|
||||
|
||||
var ITEM_TEMPLATE = '' +
|
||||
'<a class="participant-entry-link" href="#{{sessionId}}" data-token="{{token}}">' +
|
||||
'<a class="participant-entry-link {{#if isOffline}}participant-offline{{/if}}" href="#{{sessionId}}" data-token="{{token}}">' +
|
||||
'<div class="avatar" data-user-id="{{userId}}" data-displayname="{{displayName}}"></div>' +
|
||||
' {{displayName}}' +
|
||||
'{{#if participantIsOwner}}<span class="participant-moderator-indicator">(' + t('spreed', 'moderator') + ')</span>{{/if}}' +
|
||||
|
@ -124,7 +124,7 @@
|
|||
this.$el.attr('data-session-id', this.model.get('sessionId'));
|
||||
this.$el.attr('data-participant', this.model.get('userId'));
|
||||
this.$el.addClass('participant');
|
||||
if (this.model.get('pariticipantIsOffline')) {
|
||||
if (!this.model.isOnline()) {
|
||||
this.$el.addClass('participant-offline');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче