Add default export for initializeShareon.
It allows to initialize share button after window.load, for example on SPA dynamic element.pull/12/head
parent
51b918ef94
commit
4db5ac324b
|
@ -44,7 +44,7 @@ function initShareonChild(child: HTMLElement, preset: PublishPreset) {
|
|||
}
|
||||
}
|
||||
|
||||
window.onload = () => {
|
||||
const initializeShareon = () : void => {
|
||||
const shareonContainers = document.getElementsByClassName('shareon');
|
||||
|
||||
for (let i = 0; i < shareonContainers.length; i += 1) {
|
||||
|
@ -70,3 +70,7 @@ window.onload = () => {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.onload = () => { initializeShareon(); };
|
||||
|
||||
export default initializeShareon;
|
||||
|
|
Loading…
Reference in New Issue