-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add another button beside wdt-emoji-picker #37
Comments
Currently, it appends picker as a child to input's parent. Here is a quick solution; 1- Add a parameter to init function named "container"; wdt-emoji-bundle/wdt-emoji-bundle.js Line 54 in 714c82b
wdtEmojiBundle.init = function (selector, container) { 2- Pass this parameter to addPicker function on line 138; wdt-emoji-bundle/wdt-emoji-bundle.js Line 138 in 714c82b
self.addPicker(self.elements[i], container); 2- Select correct container in addPicker function. wdtEmojiBundle.addPicker = function (element, container) {
container = container || false;
var self = this;
if (!hasClass(element, 'wdt-emoji-picker-ready')) {
var p = document.createElement('div');
addClass(p, 'wdt-emoji-picker');
p.innerHTML = self.emoji.replace_colons(':smile:');
p.addEventListener('click', wdtEmojiBundle.openPicker);
var parent = element.parentNode;
addClass(parent, 'wdt-emoji-picker-parent');
if (container) {
parent.querySelector(container).appendChild(p);
} else {
parent.appendChild(p);
}
if (hasClass(element, 'wdt-emoji-open-on-colon')) {
parent.addEventListener('keyup', wdtEmojiBundle.onKeyup)
}
addClass(element, 'wdt-emoji-picker-ready');
}
}; |
Usage should be like this; wdtEmojiBundle.init('.your-inputs-selector', '.your-container'); Container must be child of input's parent. |
@needim i want to add other buttons with my wdt-emoji-picker inside form-group wdt-emoji-picker-parent
like this
do u have any method for that?
The text was updated successfully, but these errors were encountered: