1/* ******************************************************* 2 * filename : layer_popup.js 3 * description : 모ë¬ë ì´ì´ë¥¼ ëì¸ë ì¬ì©ëë ajax JS 4 * date : 2022-03-14 5******************************************************** */ 6 7 8// Modal Open 9$(document).on("click",".cm-modal-open-btn",function () { 10 if ( $(".modal-fixed-pop-wrapper").length > 0 ) { 11 ajaxLoad($(this).attr("href")); 12 $(".modal-fixed-pop-wrapper:last-child").css("background-color","transparent"); 13 }else { 14 ajaxLoad($(this).attr("href")); 15 } 16 return false; 17}); 18 19 /* ************************ 20 * Modal ìì ìì± 21 ************************ */ 22function addModalLayer () { 23 var modalHtml = ''; 24 modalHtml += '<article class="modal-fixed-pop-wrapper">'; 25 modalHtml += '<div class="modal-loading"><span class="loading"></span></div>'; 26 modalHtml += '<div class="modal-fixed-pop-inner">'; 27 modalHtml += '<div class="modal-inner-box">'; 28 modalHtml += '<div class="modal-inner-content">'; 29 modalHtml += '</div>'; 30 modalHtml += '</div>'; 31 modalHtml += '</div>'; 32 modalHtml += '</div>'; 33 modalHtml += '</article>'; 34 35 $('body').append(modalHtml); 36} 37 38 /* ************************ 39 * Ajax Load 40 * @param strUrl : 모ë¬ë ì´ì´íì 주ì 41 ************************ */ 42// Ajax Load 43function ajaxLoad(strUrl){ 44 addModalLayer(); 45 var $modalWrap = $(".modal-fixed-pop-wrapper:last-child"); 46 $modalWrap.fadeIn(); 47 htmlScrollControl (true); 48 $.ajax({ 49 type: "POST", 50 url: strUrl, 51 data: "", 52 success: function(resultText){ 53 $modalWrap.find(".modal-inner-content").html(resultText).find(".modal-close-btn").focus(); 54 $(document).keydown(function(event) { 55 if ( event.keyCode == 27 || event.which == 27 ) { 56 if ( $modalWrap.css("display") == "block" ) { 57 ajaxUnLoad(); 58 } 59 } 60 }); 61 }, 62 error: function() { 63 if ( $("html").attr("lang") == "ko" ) { 64 alert("í¸ì¶ì ì¤í¨íììµëë¤."); 65 }else { 66 alert("Please try again."); 67 } 68 69 $(".modal-fixed-pop-wrapper").hide(); 70 htmlScrollControl (false); 71 }, 72 beforeSend:function(){ 73 $('.modal-loading').show(); 74 }, 75 complete:function(){ 76 $('.modal-loading').hide(); 77 } 78 }); 79} 80// ë³ê²½ì í¨ìëª (ì¤ë¥ë¥¼ ë§ê¸°ìí´ ì¬ì©) 81function layerLoad (strUrl) { 82 ajaxLoad(strUrl); 83} 84 85 /* ************************ 86 * Ajax UnLoad 87 * Modal Layer Popup Close 88 * ë«ê¸°ë²í¼, ì·¨ìë²í¼ ë±ì onclick="ajaxUnLoad();" 89 ************************ */ 90function ajaxUnLoad () { 91 if ( $(".modal-fixed-pop-wrapper").length > 1 ) { 92 $(".modal-fixed-pop-wrapper:last-child").fadeOut(10, function () { 93 $(this).remove(); 94 }); 95 }else { 96 htmlScrollControl (false); 97 $(".modal-fixed-pop-wrapper").fadeOut(10, function () { 98 $(this).remove(); 99 }); 100 } 101}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.