| # 5 years ago | |
|---|---|
|
currently i'm using 2 wordarts in 2 different route, when i redirect(its not hard reload similar to clientside framework doing like react/angular) to second page its looking empty(no image in canvas), i need to hard refresh to draw it again then the first page become empty is there any function available in wordart.min.js to reload if i'm changing URL? |
|
| # 5 years ago | |
|---|---|
| Hi! There is no function in wordart.min.js to reload but you can try to change the size of the div element. It will force your word art to redraw. | |
| # 5 years ago | |
|---|---|
|
if we adding a div with class="tagul-word-cloud" & data-tagul-src="assets/wordart.json" dynamically after some time in dom, its not picked by wordart.min.js you are using window.addEventListener( "load", () => {} ) to draw canvas if the div with data-tagul-src="assets/wordart.json" not available in dom at initial loading & its dynamically adding after some time |
|
| # 5 years ago | |
|---|---|
| Then try to add wordart.min.js after you add the div element. The script will be automatically executed even if page is loaded. | |
| # 5 years ago | |
|---|---|
| I think, providing a render or reload function is better to handle this from modern SPA frameworks | |
| # 5 years ago | |
|---|---|
| Thank you for you suggestion. We will consider it for inclusion in future versions of the software. | |
| # 5 years ago | |
|---|---|
| Is there any way to get notification of this functionality implementation? | |
| # 5 years ago | |
|---|---|
| I'll post it here. But we don't have immediate plans to implement this. Did my suggestion to add wordart.min.js after div element work? | |
| # 5 years ago | |
|---|---|
|
yup that's working but it's not the standard way export const reloadScriptTag = url => { const existingScriptTag = document.querySelector(`script[src="${url}"]`); if (existingScriptTag) existingScriptTag.remove(); const scriptTag = document.createElement("script" ) ; document.body.appendChild(scriptTag); scriptTag.src = url; return scriptTag; }; |
|