// S-modal function sModal(popup, func) { func = typeof func !== 'undefined' ? func : ''; $('.s-modal').toggleClass('s-show-modal'); $('body').css('overflow', 'hidden'); const template = $(popup).clone(true); var element = $(template.html()); // popup에서 #제거 var modal_id = popup.replace("#", ""); modal_id = modal_id+'Modal'; $('.s-modal').attr('id', modal_id); $('.s-modal-body').html(element); $('.s-close-button').on('click', function () { sModalClose(); }); if (typeof func === 'function') { func(); } } function sModalClose() { $('.s-modal').removeClass('s-show-modal'); $('.s-modal-body').empty(); $('.s-modal').attr('id', ''); $('body').css('overflow', 'unset'); } //알림 팝업 function alertSet(html,icon,action){ Swal.fire({ html: html, icon: icon, buttonsStyling: false, confirmButtonText: "확인", showClass: { popup: 'animate__animated animate__fadeIn animate__fast', }, hideClass: { popup: 'animate__animated animate__fadeOut animate__faster' }, customClass: { confirmButton: "btn" } }).then(function() { if (typeof action === 'function'){ action(); }else{ if(action == '#reload'){ window.location.reload(); }else{ if(action != '#'){ goToLink(action); } } } }); } //컨펌 팝업 function confirmSet(html,icon,action){ Swal.fire({ html: html, icon: icon, showClass: { popup: 'animate__animated animate__fadeIn animate__fast', }, hideClass: { popup: 'animate__animated animate__fadeOut animate__faster' }, customClass: { confirmButton: "btn", cancelButton: "btn" }, showCancelButton: true, cancelButtonText: "취소", confirmButtonText: "확인", reverseButtons: true, }).then(function(result){ if (result.isConfirmed) { if (typeof action === 'function'){ action(); }else{ alertSet('처리되었습니다.','success','#'); } } else if (result.isDismissed) { // alertSet('취소되었습니다.','info','#'); } }); }