Fix error when closing modals

Helps with #64 #49
This commit is contained in:
Ray Schamp 2015-11-25 13:23:13 -05:00
parent 6c8c5512c8
commit 3b51d345cf

View file

@ -246,7 +246,11 @@ function showModal(templateId, data) {
$(document).one("modal:exit page:show editor:extensionLoaded", function(e){ $(document).one("modal:exit page:show editor:extensionLoaded", function(e){
$("body").removeClass("modal-open"); $("body").removeClass("modal-open");
try {
Scratch.FlashApp.ASobj.ASsetModalOverlay(false); Scratch.FlashApp.ASobj.ASsetModalOverlay(false);
} catch (e) {
// SWF not yet loaded
}
$modal.remove(); $modal.remove();
}); });
@ -258,7 +262,13 @@ $(document).keyup(function(e) {
if (e.keyCode == 27) $(document).trigger("modal:exit"); if (e.keyCode == 27) $(document).trigger("modal:exit");
}); });
$(document).on("modal:exit", function(e){Scratch.FlashApp.ASobj.ASsetModalOverlay(false);}); $(document).on("modal:exit", function(e){
try {
Scratch.FlashApp.ASobj.ASsetModalOverlay(false);
} catch (e) {
// SWF not yet loaded
}
});
$(document).on('click', "[data-action='modal']", function(e){ $(document).on('click', "[data-action='modal']", function(e){
/* /*