forked from lubiana/futtern
#97: add emojis to foodvendor
This commit is contained in:
parent
e2167fa19f
commit
c8e6af6896
7 changed files with 176 additions and 4 deletions
14
assets/javascript/emoji-button.js
Normal file
14
assets/javascript/emoji-button.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
const emojiButtonListener = function () {
|
||||
const buttons = document.querySelectorAll('.emoji-buttons .btn.btn-primary');
|
||||
|
||||
buttons.forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
const emojiField = document.querySelector('#food_vendor_emojis');
|
||||
if (emojiField) {
|
||||
emojiField.value += this.textContent;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default emojiButtonListener;
|
Loading…
Add table
Add a link
Reference in a new issue