diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 05e6457cc..26d34bb9d 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -426,13 +426,14 @@ function hideModal(el) { if($("#popupWrap").length > 0){ $("#popupWrap").hide(); } - else{ - var modal; - if (el) { - modal = $(el).parents('.ui-dialog-content'); - } else { - modal = $('#ajax-modal'); - } + + var modal; + if (el) { + modal = $(el).parents('.ui-dialog-content'); + } else { + modal = $('#ajax-modal'); + } + if(modal != null){ modal.dialog("close"); } }