Node module integration Not working in Kaiwa
patelvanita360 opened this issue · comments
Hello All,
I am doing integration of following Node Module in Kaiwa for send emoji in chat.
https://www.npmjs.com/package/emojionearea
I follow below steps
- npm install emojionearea --save
- create custom.js file
- Add following code in custom.js fil
$(document).ready(function() {
$(".emojionearea").emojioneArea();
});
- Add class emojionearea to chat input textarea in chat.jade
- Add
var emoji = require('node-emoji'); var emojipicker = require('emojionearea'); require('custom.js');
in chat.js
But not getting any result front side, can you please check where i am doing mistake ?
Not getting any error in console.
I think the chat input area is not ready yet on document.ready event. Try to call your jquery plugin in render() function in pages/chat.js
tried. Still not working
render: function () {
if (this.rendered) return this;
var self = this;
this.rendered = true;
this.renderAndBind();
var emoji = require('node-emoji');
var emojipicker = require('emojionearea');
require('custom.js');
this works for me - https://pastebin.com/xM9tiMW2
Thank You. Working Now :) :)