MCPcopy Create free account
hub / github.com/buddycloud/webclient / avatarFallback

Function avatarFallback

js/app/util/avatarFallback.js:20–27  ·  view source on GitHub ↗
(avatarElements, type, size)

Source from the content-addressed store, hash-verified

18 var $ = require('jquery');
19
20 function avatarFallback(avatarElements, type, size) {
21 var fallbackImage;
22 $(avatarElements).one('error', function(event) {
23 type = event.target.dataset['type'] || type;
24 fallbackImage = 'img/' + type + '-' + size + 'px.jpg';
25 event.target.src = fallbackImage;
26 });
27 }
28
29 return avatarFallback;
30});

Callers 9

PersonalChannel.jsFile · 0.85
Channels.jsFile · 0.85
PostView.jsFile · 0.85
ChannelStream.jsFile · 0.85
ChannelHeader.jsFile · 0.85
ChannelList.jsFile · 0.85
DiscoverOverlay.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected