add tweomji transfer for single emojis

This commit is contained in:
Milos Holba
2021-02-01 19:43:30 +01:00
parent 9c147165e1
commit ba5e05f77a
6 changed files with 191 additions and 104 deletions
+15 -3
View File
@@ -353,19 +353,31 @@ const Helpers = {
body.classList.add('windows')
}
},
Vue.prototype.$emojisCustomize = function (elementId) {
Vue.prototype.$transferListTwemoji = function (elementId) {
// Transfer whole DOOM or set element to twemoji
this.$nextTick(() => {
let list = elementId ? document.getElementById(elementId) : document.body
twemoji.parse(list, {
folder: 'svg',
ext: '.svg',
attributes: () => ({
loading: 'lazy'
loading: 'lazy',
})
})
})
},
Vue.prototype.$transferSingleTwemoji = function (emoji, jsonParse) {
// Transfer single emoji to twemoji
return twemoji.parse( !jsonParse ? emoji : JSON.parse(emoji).char , {
folder: 'svg',
ext: '.svg',
attributes: () => ({
loading: 'lazy',
})
})
}
}
}