From d5b63730bcec9a14645dd3be524eb5b872bef9d5 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 30 Mar 2016 18:09:46 +1100 Subject: [PATCH] don't bother with register emoji if dialect is missing --- .../javascripts/discourse/lib/emoji/emoji.js.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb index 92a1071f371..4643cf34fa6 100644 --- a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb +++ b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb @@ -8,10 +8,12 @@ var emoji = <%= Emoji.standard.map(&:name).flatten.inspect %>; var aliases = <%= Emoji.aliases.inspect.gsub("=>", ":") %>; var extendedEmoji = {}; -Discourse.Dialect.registerEmoji = function(code, url) { - code = code.toLowerCase(); - extendedEmoji[code] = url; -}; +if (Discourse.Dialect) { + Discourse.Dialect.registerEmoji = function(code, url) { + code = code.toLowerCase(); + extendedEmoji[code] = url; + }; +} var _unicodeReplacements; var _unicodeRegexp;