|
1 |
| -if (typeof SurveyCreatorCore !== "undefined") { |
2 |
| - new SurveyCreatorCore.SurveyCreatorModel(); // Register Survey Creator icons |
3 |
| - } |
4 |
| - |
5 |
| - function renderIcons() { |
6 |
| - let iconsDiv = document.createElement("div"); |
7 |
| - iconsDiv.id = "sv-icon-holder-global-container"; |
8 |
| - iconsDiv.innerHTML = "<svg>" + Survey.SvgRegistry.iconsRenderedHtml() + "</svg>"; |
9 |
| - iconsDiv.style.display = "none"; |
10 |
| - document.head.appendChild(iconsDiv); |
11 |
| - } |
12 |
| - renderIcons(); |
13 |
| - |
14 |
| - Object.keys(Survey.SvgRegistry.icons).map(name => { |
15 |
| - if (name.indexOf("pg-v1") > -1) return; |
16 |
| - const element = document.createElement("div"); |
17 |
| - element.classList.add("container") |
18 |
| - element.innerHTML = ` |
19 |
| - <svg> |
20 |
| - <use xlink:href="#icon-` + name + `\"></use> |
21 |
| - </svg> |
22 |
| - <span class="icon-name">icon-` + name + `</span>`; |
23 |
| - document.getElementById("icons").appendChild(element); |
24 |
| - }); |
| 1 | +function renderIcons() { |
| 2 | + let iconsDiv = document.createElement("div"); |
| 3 | + iconsDiv.id = "sv-icon-holder-global-container"; |
| 4 | + iconsDiv.innerHTML = "<svg>" + Survey.SvgRegistry.iconsRenderedHtml() + "</svg>"; |
| 5 | + iconsDiv.style.display = "none"; |
| 6 | + document.head.appendChild(iconsDiv); |
| 7 | +} |
| 8 | +renderIcons(); |
| 9 | + |
| 10 | +Object.keys(Survey.SvgRegistry.icons).map(name => { |
| 11 | + if (name.indexOf("pg-v1") > -1) return; |
| 12 | + const element = document.createElement("div"); |
| 13 | + element.classList.add("container") |
| 14 | + element.innerHTML = ` |
| 15 | + <svg> |
| 16 | + <use xlink:href="#icon-` + name + `\"></use> |
| 17 | + </svg> |
| 18 | + <span class="icon-name">icon-` + name + `</span>`; |
| 19 | + document.getElementById("icons").appendChild(element); |
| 20 | +}); |
0 commit comments