Make the plugin works with invitations

This commit is contained in:
Dmitriy Simushev 2014-09-18 09:21:55 +00:00
parent 14392ac494
commit da1e7b2352

View File

@ -17,15 +17,24 @@
*/
(function (Mibew) {
// Initialize separated Marionette.js module for the plugin.
var module = Mibew.Application.module(
'Chat.MibewEmojiPlugin',
'MibewEmojiPlugin',
{startWithParent: false}
);
// Start the module only after the parent one will be initialized.
Mibew.Application.Chat.on('start', function() {
module.start();
});
// Make the plugin works together with "Chat" and "Invitation" modules.
var eventsMap = {
'start': function() {
module.start();
},
'stop': function() {
module.stop();
}
}
Mibew.Application.Chat.on(eventsMap);
Mibew.Application.Invitation.on(eventsMap);
module.addInitializer(function() {
var imagesDir = Mibew.PluginOptions.MibewEmoji.imagesDir;