Commit 311d470a authored by Eric Eastwood's avatar Eric Eastwood Committed by Andrew Newdigate

Fix avatars for new groups in the old left menu used on mobile

parent 9629820f
"use strict"; "use strict";
var Marionette = require('backbone.marionette'); var Marionette = require('backbone.marionette');
var avatars = require('gitter-web-avatars');
var orgListItemTemplate = require('./tmpl/org-list-item.hbs'); var orgListItemTemplate = require('./tmpl/org-list-item.hbs');
var appEvents = require('../../../utils/appevents'); var appEvents = require('../../../utils/appevents');
var troupesCollections = require('../../../collections/instances/troupes'); var troupesCollections = require('../../../collections/instances/troupes');
var resolveRoomAvatarSrcSet = require('gitter-web-shared/avatars/resolve-room-avatar-srcset');
module.exports = (function() { module.exports = (function() {
...@@ -27,7 +27,7 @@ module.exports = (function() { ...@@ -27,7 +27,7 @@ module.exports = (function() {
serializeData: function() { serializeData: function() {
var data = this.model.toJSON(); var data = this.model.toJSON();
data.roomAvatarSrcSet = resolveRoomAvatarSrcSet({uri: data.name}, 16); data.avatarUrl = avatars.getForGitHubUsername(data.name);
return data; return data;
}, },
......
...@@ -12,7 +12,6 @@ var appEvents = require('../../../utils/appevents'); ...@@ -12,7 +12,6 @@ var appEvents = require('../../../utils/appevents');
var dataset = require('../../../utils/dataset-shim'); var dataset = require('../../../utils/dataset-shim');
var toggle = require('../../../utils/toggle'); var toggle = require('../../../utils/toggle');
var toggleClass = require('../../../utils/toggle-class'); var toggleClass = require('../../../utils/toggle-class');
var resolveRoomAvatarSrcSet = require('gitter-web-shared/avatars/resolve-room-avatar-srcset');
require('jquery-sortable'); // eslint-disable-line node/no-missing-require require('jquery-sortable'); // eslint-disable-line node/no-missing-require
...@@ -95,7 +94,6 @@ module.exports = (function() { ...@@ -95,7 +94,6 @@ module.exports = (function() {
serializeData: function() { serializeData: function() {
var data = this.model.toJSON(); var data = this.model.toJSON();
data.name = roomNameTrimmer(data.name, MAX_NAME_LENGTH); data.name = roomNameTrimmer(data.name, MAX_NAME_LENGTH);
data.roomAvatarSrcSet = resolveRoomAvatarSrcSet({ uri: data.url }, 16);
return data; return data;
}, },
......
<div class="room-list-item__icon"> <div class="room-list-item__icon">
<img src='{{roomAvatarSrcSet.src}}' srcset='{{roomAvatarSrcSet.srcset}}' height='{{roomAvatarSrcSet.size}}' width='{{roomAvatarSrcSet.size}}'> <img {{{ avatarSrcSet avatarUrl 16 }}} >
</div> </div>
<span class="room-list-item__name">{{ name }}</span> <span class="room-list-item__name">{{ name }}</span>
<div class="room-list-item__icon"> <div class="room-list-item__icon">
{{#if favourite}}<i class="icon-star-1 room-list-item__icon--favourite"></i>{{/if}} {{#if favourite}}<i class="icon-star-1 room-list-item__icon--favourite"></i>{{/if}}
<img src='{{roomAvatarSrcSet.src}}' srcset='{{roomAvatarSrcSet.srcset}}' height='{{roomAvatarSrcSet.size}}' width='{{roomAvatarSrcSet.size}}'> <img {{{ avatarSrcSet avatarUrl 16 }}} >
</div> </div>
<span id="room-name" class="room-list-item__name" title="{{title}}">{{ name }}</span> <span id="room-name" class="room-list-item__name" title="{{title}}">{{ name }}</span>
<i class="room-list-item__action js-close-button icon-cancel-circle" data-id="{{ id }}"></i> <i class="room-list-item__action js-close-button icon-cancel-circle" data-id="{{ id }}"></i>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment