js 오타 및 상세검색페이지소스 수정

This commit is contained in:
JSYOO 2021-11-02 09:59:05 +09:00
parent 1ae8b724e9
commit 826dc9df79
2 changed files with 2 additions and 130 deletions

View File

@ -97,139 +97,11 @@ $(document).ready(function(){
// 상세검색 팝업 - 문화원정보 선택영역 초기작업 메서드 분리 // 상세검색 팝업 - 문화원정보 선택영역 초기작업 메서드 분리
jQuery(function($) { jQuery(function($) {
var depth2H = 0;
$('.pop-advanced-search .depth1-check input').each(function () {
if ($(this).is(":checked")) { // 활성화 line에 높이 잡아주기
$('.depth1').removeClass('on');
$(this).parents('.depth1').addClass('on');
depth2H = $(this).parents('.depth1-check').next('.depth2').outerHeight();
$(this).parents('.line').siblings('.line').attr('style', '');
$(this).parents('.line').height(depth2H + 50);
}
$(this).siblings('.tab-name').on('click', function() {
$('.depth1').removeClass('on');
$(this).parents('.depth1').addClass('on');
depth2H = $(this).parents('.depth1-check').next('.depth2').outerHeight();
$('.line').attr('style', '');
$(this).parents('.line').height(depth2H + 50);
});
});
$('.pop-advanced-search .depth2 input').change(function() {
var html = "";
var depth1 = "";
var depth2 = "";
/*alert(name.substring(name.indexOf("_")+1, name.length));*/
if ($(this).is(':checked')) {
depth1 = $(this).parents('.depth2').siblings('.depth1-check').find('label').text();
depth2 = $("label[for='"+$(this).attr('id')+"']").text();
html = "<li><button type=\"button\" onclick=\"function('');\" title=\"삭제\" name=\""+ $(this).attr('id') +"\">" + depth1 + "<span class=\"sign\"> > </span>"+ depth2 +"</button></li>"
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', true);
$(this).parents('.conditions-box').siblings('.selected-conditions').find('.conditions').append(html);
} else {
$("button[name="+$(this).attr('id')+"]").remove();
if ($(this).parents('.depth2').find('input:checked').length <= 0) {
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', false);
}
}
//filter_mylist clk array
var filter_mylist = "";
var filter_mylist_clk = "";
filter_mylist = $('#d_filter_mylist').val();
if($(this).attr('name') == 'second_class'){
filter_mylist_clk = 'class_'+$(this).val() +',';
}else if($(this).attr('name') == 'second_category'){
filter_mylist_clk = 'category_'+$(this).val() +',';
}
if($(this).is(":checked")){
filter_mylist += filter_mylist_clk;
}else{
filter_mylist = filter_mylist.replace(filter_mylist_clk,'');
}
$('#d_filter_mylist').val(filter_mylist);
//depth-1
var on_classArr = document.querySelectorAll("div.depth1.on");
var filter_class = "" ;
var filter_category = "" ;
for(var i=0; i<on_classArr.length; i++){
if($(on_classArr[i]).find('input').attr('name') == 'first_class') {
filter_class = $(on_classArr[i]).find('input').val();
}else{
filter_category = $(on_classArr[i]).find('input').val();
}
}
var listForm = document.forms["d_referencelistForm"];
listForm.filter_class.value = filter_class;
listForm.filter_category.value = filter_category;
});
// 상세검색 초기화
$('.pop-advanced-search .btn-reset-conditions').on('click', function() {
$("input[id^='"+$(this).attr('name')+"-chk']").each(function() {
$(this).prop('checked', false);
});
$(this).parents('.title').siblings('.conditions').find('*').remove();
});
// depth-1 열고 닫기
$('.filter-tit .btn-toggle').on('click', function() {
if($(this).text() == '닫기') {
$(this).text('열기');
$(this).parent('.filter-tit').siblings('.filter-list').stop().slideUp();
$('.filter .btn-toggle-more').css('display','none');
} else {
$(this).text('닫기');
$(this).parent('.filter-tit').siblings('.filter-list').stop().slideDown();
$('.filter .btn-toggle-more').css('display','block');
}
});
// depth-2 열고 닫기
$('.filter .depth-1 .btn-toggle').on('click', function () {
var _this = $(this).parents('li').index();
if ($(this).text() == '닫기') {
$(this).text('열기');
$(this).siblings('.check').find('.tab-name').trigger("click");
} else {
$(this).text('닫기');
$(this).siblings('.check').find('.tab-name').trigger("click");
}
});
$('.filter-wrap .tab-name').on('click', function() {
if ($('body').hasClass('pop-filter')) {
$(this).parents('.depth-1').removeClass('on');
}
});
// 상세검색 팝업 열기 // 상세검색 팝업 열기
$('.btn-search-detail').on('click', function () { $('.btn-search-detail').on('click', function () {
// 클릭 시, 컨텐츠 로딩되도록 처리 (2021.10.20 DDDDDDDDDD 추가) : 시작 // 클릭 시, 컨텐츠 로딩되도록 처리 (2021.10.20 DDDDDDDDDD 추가) : 시작
$("#NLIB_LAYER_POPUP").addClass("popup pop-advanced-search"); fn_layerPopWithClass("/search/getDetailedSearchFormPopup.do", "popup pop-advanced-search");
$("#NLIB_LAYER_POPUP").load("/search/getDetailedSearchFormPopup.do");
// 클릭 시, 컨텐츠 로딩되도록 처리 (2021.10.20 DDDDDDDDDD 추가) : 종료 // 클릭 시, 컨텐츠 로딩되도록 처리 (2021.10.20 DDDDDDDDDD 추가) : 종료
$('.pop-advanced-search').fadeIn();
$('html,body').addClass('no-scroll');
});
//팝업닫기버튼 클릭
$('.btn-close-pop').on('click', function () {
$(this).parents('.popup').fadeOut();
$('html,body').removeClass('no-scroll');
}); });
}); });

View File

@ -87,7 +87,7 @@ function fn_openLayerPopup(title, content, linkName, linkUrl) {
} }
function fn_closeLayerPopup() { function fn_closeLayerPopup() {
$("#NLB_LAYER_POPUP").html(""); $("#NLIB_LAYER_POPUP").html("");
$("#NLIB_LAYER_POPUP").fadeOut(); $("#NLIB_LAYER_POPUP").fadeOut();
$("#NLIB_LAYER_POPUP").removeClass(); $("#NLIB_LAYER_POPUP").removeClass();
$('html,body').removeClass('no-scroll'); $('html,body').removeClass('no-scroll');