From 7bcecb54fd5bf2185849c870c286e0fde7de4c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 29 Dec 2014 23:04:37 +0100 Subject: [PATCH] FEATURE: remember last emoji group used --- .../javascripts/discourse/lib/emoji/emoji-toolbar.js.es6 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/emoji/emoji-toolbar.js.es6 b/app/assets/javascripts/discourse/lib/emoji/emoji-toolbar.js.es6 index bf859d767..dabbb52fa 100644 --- a/app/assets/javascripts/discourse/lib/emoji/emoji-toolbar.js.es6 +++ b/app/assets/javascripts/discourse/lib/emoji/emoji-toolbar.js.es6 @@ -43,7 +43,6 @@ var closeSelector = function(){ var ungroupedIcons; var toolbar = function(selected){ - if(!ungroupedIcons){ ungroupedIcons = []; var groupedIcons = {}; @@ -108,6 +107,9 @@ var bindEvents = function(page,offset){ }; var render = function(page, offset){ + localStorage.emojiPage = page; + localStorage.emojiOffset = offset; + var rows = []; var row = []; var icons = groups[page].icons; @@ -144,7 +146,9 @@ var showSelector = function(){ closeSelector(); }); - render(0,0); + var page = parseInt(localStorage.emojiPage) || 0; + var offset = parseInt(localStorage.emojiOffset) || 0; + render(page, offset); $('body, textarea').on('keydown.emoji', function(e){ if(e.which === 27){