FIX: hide emoji toolbar button when emoji are disabled

This commit is contained in:
Régis Hanol 2014-12-29 17:29:04 +01:00
parent 1055fc0919
commit a115b4b7f0
2 changed files with 18 additions and 5 deletions

View File

@ -0,0 +1,17 @@
import { showSelector } from "discourse/lib/emoji/emoji-toolbar";
export default {
name: 'enable-emoji',
after: 'inject-objects',
initialize: function(container) {
var siteSettings = container.lookup('site-settings:main');
if (siteSettings.enable_emoji) {
window.PagedownCustom.appendButtons.push({
id: 'wmd-emoji-button',
description: I18n.t("composer.emoji"),
execute: showSelector
});
}
}
};

View File

@ -154,8 +154,4 @@ var showSelector = function(){
}); });
}; };
window.PagedownCustom.appendButtons.push({ export { showSelector };
id: 'wmd-emoji-button',
description: I18n.t("composer.emoji"),
execute: showSelector
});