-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0212883
commit 4bcb8b5
Showing
1 changed file
with
25 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
if (typeof SurveyCreatorCore !== "undefined") { | ||
new SurveyCreatorCore.SurveyCreatorModel({}); // Register Survey Creator icons | ||
} | ||
|
||
function renderIcons() { | ||
let iconsDiv = document.createElement("div"); | ||
iconsDiv.id = "sv-icon-holder-global-container"; | ||
iconsDiv.innerHTML = "<svg>" + Survey.SvgRegistry.iconsRenderedHtml() + "</svg>"; | ||
iconsDiv.style.display = "none"; | ||
document.head.appendChild(iconsDiv); | ||
} | ||
renderIcons(); | ||
|
||
Object.keys(Survey.SvgRegistry.icons).map(name => { | ||
if (name.indexOf("pg-v1") > -1) return; | ||
const element = document.createElement("div"); | ||
element.classList.add("container") | ||
element.innerHTML = ` | ||
<svg> | ||
<use xlink:href="#icon-` + name + `\"></use> | ||
</svg> | ||
<span class="icon-name">icon-` + name + `</span>`; | ||
document.getElementById("icons").appendChild(element); | ||
document.addEventListener("DOMContentLoaded", (event) => { | ||
if (typeof SurveyCreatorCore !== "undefined") { | ||
new SurveyCreatorCore.SurveyCreatorModel({}); // Register Survey Creator icons | ||
} | ||
|
||
function renderIcons() { | ||
let iconsDiv = document.createElement("div"); | ||
iconsDiv.id = "sv-icon-holder-global-container"; | ||
iconsDiv.innerHTML = "<svg>" + Survey.SvgRegistry.iconsRenderedHtml() + "</svg>"; | ||
iconsDiv.style.display = "none"; | ||
document.head.appendChild(iconsDiv); | ||
} | ||
renderIcons(); | ||
|
||
Object.keys(Survey.SvgRegistry.icons).map(name => { | ||
if (name.indexOf("pg-v1") > -1) return; | ||
const element = document.createElement("div"); | ||
element.classList.add("container") | ||
element.innerHTML = ` | ||
<svg> | ||
<use xlink:href="#icon-` + name + `\"></use> | ||
</svg> | ||
<span class="icon-name">icon-` + name + `</span>`; | ||
document.getElementById("icons").appendChild(element); | ||
}); | ||
}); |