mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
correct tests and implemenation
This commit is contained in:
parent
b7f6df7d0c
commit
dd6e38133a
2 changed files with 2 additions and 2 deletions
|
@ -82,7 +82,7 @@ Discourse.Utilities = {
|
|||
var classes = "avatar" + (options.extraClasses ? " " + options.extraClasses : "");
|
||||
var title = (options.title) ? " title='" + Handlebars.Utils.escapeExpression(options.title || "") + "'" : "";
|
||||
|
||||
return "<img alt='" + (title || "avatar") + "' width='" + size + "' height='" + size + "' src='" + Discourse.getURLWithCDN(url) + "' class='" + classes + "'" + title + ">";
|
||||
return "<img alt='" + (options.title || "avatar") + "' width='" + size + "' height='" + size + "' src='" + Discourse.getURLWithCDN(url) + "' class='" + classes + "'" + title + ">";
|
||||
},
|
||||
|
||||
tinyAvatar: function(avatarTemplate, options) {
|
||||
|
|
|
@ -130,7 +130,7 @@ test("avatarImg", function() {
|
|||
"it returns the avatar html");
|
||||
|
||||
equal(utils.avatarImg({avatarTemplate: avatarTemplate, size: 'tiny', title: 'evilest trout'}),
|
||||
"<img alt='avatar' width='20' height='20' src='/path/to/avatar/40.png' class='avatar' title='evilest trout'>",
|
||||
"<img alt='evilest trout' width='20' height='20' src='/path/to/avatar/40.png' class='avatar' title='evilest trout'>",
|
||||
"it adds a title if supplied");
|
||||
|
||||
equal(utils.avatarImg({avatarTemplate: avatarTemplate, size: 'tiny', extraClasses: 'evil fish'}),
|
||||
|
|
Loading…
Reference in a new issue