mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2025-02-16 11:09:44 -05:00
Allow modals of several elements
This commit is contained in:
parent
e6dec3fb34
commit
06e5019760
1 changed files with 10 additions and 2 deletions
|
@ -46,7 +46,7 @@ function JSprojectLoaded() {
|
|||
}
|
||||
|
||||
function JSshowExtensionDialog() {
|
||||
showModal("dialogs");
|
||||
showModal(["template-extension-file", "template-extension-url"]);
|
||||
}
|
||||
|
||||
var extensionQueue = [];
|
||||
|
@ -201,7 +201,15 @@ function getOrCreateFromTemplate(elementId, templateId, elementType, appendTo, w
|
|||
|
||||
var $element = $(document.getElementById(elementId));
|
||||
if (!$element.length) {
|
||||
$template = _.template($(document.getElementById(templateId)).html());
|
||||
var templateContent = "";
|
||||
if (typeof(templateId) != "string") {
|
||||
for (var id in templateId) {
|
||||
templateContent += $(document.getElementById(templateId[id])).html();
|
||||
}
|
||||
} else {
|
||||
templateContent += $(document.getElementById(templateId)).html()
|
||||
}
|
||||
$template = _.template(templateContent);
|
||||
$element = $("<"+elementType+"></"+elementType+">")
|
||||
.attr("id", elementId)
|
||||
.html($template(data));
|
||||
|
|
Loading…
Reference in a new issue