| @@ -5,11 +5,21 @@ | ||
| 5 | 5 | function __tagembed__open_loader(text = '', loaderImage = '') { |
| 6 | 6 | text = (text) ? text : 'Please Wait...'; |
| 7 | 7 | loaderImage = (loaderImage) ? loaderImage : __tagembedLoaderImageCustomPath; |
| 8 | 8 | document.body.style.cursor = "wait"; |
| 9 | - let elem = document.createElement('div'); | |
| 10 | - elem.innerHTML = '<div id="__tagembed__loader" class="__tagembed__loader-overlay"><div class="__tagembed__loader"><img src="' + loaderImage + '"/><br/>' + text + '</div></div>'; | |
| 11 | - document.body.appendChild(elem.firstChild); | |
| 9 | + /* Built with DOM methods so no markup is produced from the arguments. */ | |
| 10 | + let overlay = document.createElement('div'); | |
| 11 | + overlay.setAttribute('id', '__tagembed__loader'); | |
| 12 | + overlay.className = '__tagembed__loader-overlay'; | |
| 13 | + let inner = document.createElement('div'); | |
| 14 | + inner.className = '__tagembed__loader'; | |
| 15 | + let image = document.createElement('img'); | |
| 16 | + image.setAttribute('src', loaderImage); | |
| 17 | + inner.appendChild(image); | |
| 18 | + inner.appendChild(document.createElement('br')); | |
| 19 | + inner.appendChild(document.createTextNode(text)); | |
| 20 | + overlay.appendChild(inner); | |
| 21 | + document.body.appendChild(overlay); | |
| 12 | 22 | } |
| 13 | 23 | function __tagembed__close_loader() { |
| 14 | 24 | document.body.style.cursor = "auto"; |
| 15 | 25 | let elem = document.querySelector('#__tagembed__loader'); |