|
|
|
|
@ -136,16 +136,16 @@ var activeAjaxCount = 0;
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
// Progress Block UI 생성
|
|
|
|
|
createProgressBlockUI();
|
|
|
|
|
console.log('[Ajax Block UI] 초기화 완료');
|
|
|
|
|
console.debug('[Ajax Block UI] 초기화 완료');
|
|
|
|
|
|
|
|
|
|
// activeAjaxCount 리셋 (페이지 로드 시)
|
|
|
|
|
activeAjaxCount = 0;
|
|
|
|
|
console.log('[Ajax Block UI] Ajax 카운터 초기화:', activeAjaxCount);
|
|
|
|
|
console.debug('[Ajax Block UI] Ajax 카운터 초기화:', activeAjaxCount);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Ajax 시작 시 Progress Block UI 표시
|
|
|
|
|
$(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
|
|
|
|
|
console.log('[Ajax Block UI] Ajax 시작:', ajaxOptions.url);
|
|
|
|
|
console.debug('[Ajax Block UI] Ajax 시작:', ajaxOptions.url);
|
|
|
|
|
|
|
|
|
|
// Block UI 제외 대상 URL 체크
|
|
|
|
|
if (ajaxOptions.url && ajaxOptions.url.indexOf('/system/user/duplicateCheck.ajax') !== -1) {
|
|
|
|
|
@ -154,7 +154,7 @@ $(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activeAjaxCount++;
|
|
|
|
|
console.log('[Ajax Block UI] 활성 Ajax 카운트 증가:', activeAjaxCount);
|
|
|
|
|
console.debug('[Ajax Block UI] 활성 Ajax 카운트 증가:', activeAjaxCount);
|
|
|
|
|
|
|
|
|
|
// 첫 번째 Ajax 요청일 때만 Progress Block UI 표시
|
|
|
|
|
if (activeAjaxCount === 1) {
|
|
|
|
|
@ -167,7 +167,7 @@ $(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
|
|
|
|
|
var $overlay = $('#ajax-progress-overlay');
|
|
|
|
|
if ($overlay.length > 0) {
|
|
|
|
|
$overlay.css('display', 'flex').hide().fadeIn(200);
|
|
|
|
|
console.log('[Ajax Block UI] Block UI 표시 완료');
|
|
|
|
|
console.debug('[Ajax Block UI] Block UI 표시 완료');
|
|
|
|
|
} else {
|
|
|
|
|
console.error('[Ajax Block UI] Block UI 요소를 찾을 수 없음');
|
|
|
|
|
}
|
|
|
|
|
@ -176,16 +176,16 @@ $(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
|
|
|
|
|
|
|
|
|
|
// Ajax 완료 시 Progress Block UI 제거 (성공/실패 모든 경우)
|
|
|
|
|
$(document).ajaxComplete(function(event, jqXHR, ajaxOptions) {
|
|
|
|
|
console.log('[Ajax Block UI] Ajax 완료:', ajaxOptions.url);
|
|
|
|
|
console.debug('[Ajax Block UI] Ajax 완료:', ajaxOptions.url);
|
|
|
|
|
|
|
|
|
|
// Block UI 제외 대상 URL 체크 (ajaxSend와 동일한 조건으로 수정)
|
|
|
|
|
if (ajaxOptions.url && ajaxOptions.url.indexOf('/system/user/duplicateCheck.ajax') !== -1) {
|
|
|
|
|
console.log('[Ajax Block UI] 제외 대상 URL, 카운트 감소 안함');
|
|
|
|
|
console.debug('[Ajax Block UI] 제외 대상 URL, 카운트 감소 안함');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activeAjaxCount--;
|
|
|
|
|
console.log('[Ajax Block UI] 활성 Ajax 카운트 감소:', activeAjaxCount);
|
|
|
|
|
console.debug('[Ajax Block UI] 활성 Ajax 카운트 감소:', activeAjaxCount);
|
|
|
|
|
|
|
|
|
|
// 모든 Ajax 요청이 완료되었을 때만 Progress Block UI 숨김
|
|
|
|
|
if (activeAjaxCount <= 0) {
|
|
|
|
|
@ -193,7 +193,7 @@ $(document).ajaxComplete(function(event, jqXHR, ajaxOptions) {
|
|
|
|
|
var $overlay = $('#ajax-progress-overlay');
|
|
|
|
|
if ($overlay.length > 0) {
|
|
|
|
|
$overlay.fadeOut(200);
|
|
|
|
|
console.log('[Ajax Block UI] Block UI 숨김 완료');
|
|
|
|
|
console.debug('[Ajax Block UI] Block UI 숨김 완료');
|
|
|
|
|
} else {
|
|
|
|
|
console.warn('[Ajax Block UI] Block UI 요소를 찾을 수 없어 숨길 수 없음');
|
|
|
|
|
}
|
|
|
|
|
|