init...
This commit is contained in:
15
themes/butterfly/layout/includes/third-party/abcjs/abcjs.pug
vendored
Normal file
15
themes/butterfly/layout/includes/third-party/abcjs/abcjs.pug
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
script.
|
||||
(() => {
|
||||
const abcjsInit = () => {
|
||||
const abcjsFn = () => {
|
||||
document.querySelectorAll(".abc-music-sheet").forEach(ele => {
|
||||
ABCJS.renderAbc(ele, ele.innerHTML, {responsive: 'resize'})
|
||||
})
|
||||
}
|
||||
|
||||
typeof ABCJS === 'object' ? abcjsFn()
|
||||
: getScript('!{url_for(theme.asset.abcjs_basic_js)}').then(abcjsFn)
|
||||
}
|
||||
|
||||
window.pjax ? abcjsInit() : window.addEventListener('load', abcjsInit)
|
||||
})()
|
||||
Reference in New Issue
Block a user