(function () { $("[data-role='print']").click(function () { window.print(); return false; }); if ($("#modal-multipleapplications").length > 0) { $("[data-role='apply'], [data-role='save']").liteBox({ callbackAfterOpen: function () { var $liteBox = this; var $element = $liteBox.$element; var $container = $(".litebox-container"); var formId = $element.attr("data-formid"); var $content = $($element.attr("href"), $content); // href is the modal content selector $container.width($content.width() + 40); // .litebox-container uses 20px padding $("#button-continue", $container).click(function () { $(".litebox-close").click(); pulse($element); $("#" + formId).submit(); return false; }); } }) } else { $("[data-role='apply']").click(function () { pulse($(this)); $("#apply-form").submit(); return false; }); $("[data-role='save']").click(function () { pulse($(this)); $("#save-form").submit(); return false; }); } $("#withdrawapplication").liteBox({ callbackAfterOpen: function () { var $liteBox = this; var $element = $liteBox.$element; var $container = $(".litebox-container"); var $content = $($element.attr("href"), $content); // href is the modal content selector $container.width($content.width() + 40); // .litebox-container uses 20px padding $("#button-withdraw", $container).click(function () { $(".litebox-close").click(); pulse($element); $.ajax({ url: "/public/opportunityapplications/WithdrawApplication?applicationId=" + $element.attr('data-applicationid'), dataType: "json", type: "POST" }).done(function (data) { if (data.success) { show_pnotify("success", "Withdraw Application Successful", data.message); endPulse($element); $element.hide(); } else { var noticeType = typeof data.noticeType == "undefined" ? "error" : data.noticeType; if (data.message) { show_pnotify(noticeType, "Error", "Error withdrawing application: \n" + data.message); } else { show_pnotify(noticeType, "Error", "Error withdrawing application"); } endPulse($element); } }).fail(function (data) { show_pnotify("error", "Error", "Error withdrawing application"); endPulse($element); }); return false; }); } }) })();