UX: use 🌟 icon for recently used emoji tab

This commit is contained in:
Régis Hanol 2015-02-02 22:28:58 +01:00
parent a064bad9a3
commit 03f7a12b52
1 changed files with 4 additions and 4 deletions

View File

@ -84,8 +84,7 @@ var initializeRecentlyUsedIcons = function() {
var usage = JSON.parse(localStorage.emojiUsage); var usage = JSON.parse(localStorage.emojiUsage);
var recent = _.take(_.sortByAll(usage, ["usage", "title"]).reverse(), PER_ROW); var recent = _.take(_.sortByAll(usage, ["usage", "title"]).reverse(), PER_ROW);
if(recent.length > 0){
if(recentlyUsedIcons.length > 0){
_.each(recent, function(emoji){ _.each(recent, function(emoji){
recentlyUsedIcons.push(emoji.title); recentlyUsedIcons.push(emoji.title);
}); });
@ -105,7 +104,8 @@ var toolbar = function(selected){
if (!recentlyUsedIcons) { initializeRecentlyUsedIcons(); } if (!recentlyUsedIcons) { initializeRecentlyUsedIcons(); }
return _.map(groups, function(g, i){ return _.map(groups, function(g, i){
var row = {src: Discourse.Emoji.urlFor(g.icons[0]), groupId: i}; var icon = g.name === "recent" ? "star2" : g.icons[0];
var row = {src: Discourse.Emoji.urlFor(icon), groupId: i};
if(i === selected){ if(i === selected){
row.selected = true; row.selected = true;
} }