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