|
@@ -200,6 +200,7 @@ $(document).ready(function(){
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
//multiCheckBox : Header Click
|
|
//multiCheckBox : Header Click
|
|
|
|
|
+ var mcbNowIdx;
|
|
|
$(document).on("click", ".multiCheckBox .sltBtn", function(){
|
|
$(document).on("click", ".multiCheckBox .sltBtn", function(){
|
|
|
//닫기-----
|
|
//닫기-----
|
|
|
if($(this).hasClass("on")){
|
|
if($(this).hasClass("on")){
|
|
@@ -219,8 +220,8 @@ $(document).ready(function(){
|
|
|
}
|
|
}
|
|
|
//열기-----
|
|
//열기-----
|
|
|
else {
|
|
else {
|
|
|
- //활성화된 타 multiCheckBox 처리
|
|
|
|
|
- let openObj = $(".multiCheckBox .sltBtn.on").parents(".multiCheckBox");
|
|
|
|
|
|
|
+ //활성화된 타 multiCheckBox 처리-----------------
|
|
|
|
|
+ let openObj = $(document).find(".multiCheckBox .sltBtn.on").parent(".multiCheckBox");
|
|
|
let frtTxt = openObj.find("label[data-group] input:checked").parent().eq(0).text();
|
|
let frtTxt = openObj.find("label[data-group] input:checked").parent().eq(0).text();
|
|
|
let chkLen = openObj.find("label[data-group] input:checked").length;
|
|
let chkLen = openObj.find("label[data-group] input:checked").length;
|
|
|
let chkCnt = chkLen - 1;
|
|
let chkCnt = chkLen - 1;
|
|
@@ -233,18 +234,24 @@ $(document).ready(function(){
|
|
|
} else { //체크 값이 있을때
|
|
} else { //체크 값이 있을때
|
|
|
$(".multiCheckBox .sltBtn.on").text(frtTxt + " 외 " +chkCnt).removeClass("on");
|
|
$(".multiCheckBox .sltBtn.on").text(frtTxt + " 외 " +chkCnt).removeClass("on");
|
|
|
};
|
|
};
|
|
|
- //현재 multiCheckBox 처리
|
|
|
|
|
- $(this).next("ul").css({display:"block"}); //체크 리스트 닫기
|
|
|
|
|
|
|
+ //현재 multiCheckBox 처리------------
|
|
|
|
|
+ $(this).next("ul").css({display:"block"}); //체크 리스트 열기
|
|
|
$(this).addClass("on");
|
|
$(this).addClass("on");
|
|
|
|
|
+
|
|
|
|
|
+ $(document).find(".multiCheckBox").each(function(i, e){
|
|
|
|
|
+ if( $(this).find(".sltBtn").hasClass("on")){
|
|
|
|
|
+ mcbNowIdx = i;
|
|
|
|
|
+ //console.log("버튼 클릭시 : "+ i);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
//Focus Out
|
|
//Focus Out
|
|
|
$(document).on("click", function(e){
|
|
$(document).on("click", function(e){
|
|
|
//multiCheckBox----------------------------------------------
|
|
//multiCheckBox----------------------------------------------
|
|
|
- if ( $(".multiCheckBox") != undefined ) {
|
|
|
|
|
- let nowIdx = $(".multiCheckBox .sltBtn.on").parent().index();
|
|
|
|
|
- let openObj = $(".multiCheckBox").eq(nowIdx);
|
|
|
|
|
|
|
+ if ( $(document).find(".multiCheckBox") != undefined ) {
|
|
|
|
|
+ let openObj = $(".multiCheckBox").eq(mcbNowIdx); //console.log("바닥 클릭시 : "+ mcbNowIdx);
|
|
|
if ( $(e.target).parents(".multiCheckBox").length == 0 ) {
|
|
if ( $(e.target).parents(".multiCheckBox").length == 0 ) {
|
|
|
let chkLen = openObj.find("label[data-group] input:checked").length;
|
|
let chkLen = openObj.find("label[data-group] input:checked").length;
|
|
|
let chkCnt = chkLen - 1;
|
|
let chkCnt = chkLen - 1;
|
|
@@ -262,72 +269,6 @@ $(document).ready(function(){
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- //Focus Out : multiCheckBox
|
|
|
|
|
- function mcBoxfocusOut(){
|
|
|
|
|
- let nowIdx = $(".multiCheckBox .sltBtn.on").parent().index();
|
|
|
|
|
- let openObj = $(".multiCheckBox").eq(nowIdx);
|
|
|
|
|
- if ( $(e.target).parents(".multiCheckBox").length == 0 ) {
|
|
|
|
|
- let chkLen = openObj.find("label[data-group] input:checked").length;
|
|
|
|
|
- let chkCnt = chkLen - 1;
|
|
|
|
|
- let frtTxt = openObj.find("label[data-group] input:checked").parent().eq(0).text();
|
|
|
|
|
- openObj.find("ul").css({display:"none"});
|
|
|
|
|
- if ( chkLen == 0 ){ //체크 값이 없을때
|
|
|
|
|
- let btnNm = '선택하세요';
|
|
|
|
|
- $(".multiCheckBox .sltBtn.on").text(btnNm).removeClass("on");
|
|
|
|
|
- } else { //체크 값이 있을때
|
|
|
|
|
- $(".multiCheckBox .sltBtn.on").text(frtTxt + " 외 " +chkCnt).removeClass("on");
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
-/*
|
|
|
|
|
- var body = document.querySelector("body");
|
|
|
|
|
- body.addEventListener('click', clickBodyEvent);
|
|
|
|
|
-
|
|
|
|
|
- function clickBodyEvent(event) {
|
|
|
|
|
- var target = event.target;
|
|
|
|
|
-
|
|
|
|
|
- var ClassTag = event.currentTarget.querySelector(".multiCheckBox")
|
|
|
|
|
- var btnTag = event.currentTarget.querySelector(".multiCheckBox").querySelector("button");
|
|
|
|
|
- var ulTags = event.currentTarget.querySelector(".multiCheckBox").querySelector("ul");
|
|
|
|
|
- var liTags = event.currentTarget.querySelector(".multiCheckBox").querySelector("ul").querySelectorAll("li");
|
|
|
|
|
- var labTags = event.currentTarget.querySelector(".multiCheckBox").querySelector("ul").querySelector("li").querySelector("label");
|
|
|
|
|
-
|
|
|
|
|
- console.log(ClassTag);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- if(target != ClassTag && target != ulTags && target != liTags && target != btnTag && target != labTags ) {
|
|
|
|
|
- console.log(target);
|
|
|
|
|
- var liTags = event.currentTarget.querySelector(".multiCheckBox").querySelector("ul").querySelector("li");
|
|
|
|
|
- for (var i=0; i<liTags.length; i++) {
|
|
|
|
|
- if( liTags[i] == target ) {
|
|
|
|
|
- return false;
|
|
|
|
|
- } else {
|
|
|
|
|
- $(document).find(".multiCheckBox .sltBtn").removeClass("on");
|
|
|
|
|
- $(document).find(".multiCheckBox ul").css({display:"none"});
|
|
|
|
|
- $(document).find(".multiCheckBox").addClass("on");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- $(document).find(".multiCheckBox .sltBtn").removeClass("on");
|
|
|
|
|
- $(document).find(".multiCheckBox ul").css({display:"none"});
|
|
|
|
|
- $(document).find(".multiCheckBox").addClass("on");
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // 3. review_textarea 영역이면 pass
|
|
|
|
|
- //if( target == event.currentTarget.querySelector(".review_textarea") )return;
|
|
|
|
|
-
|
|
|
|
|
- var reviewWriteInfo = event.currentTarget.querySelector(".review_write_info");
|
|
|
|
|
- reviewWriteInfo.style.display = "block";
|
|
|
|
|
- reviewWriteInfo.querySelectorAll("span").forEach( spanTag => {
|
|
|
|
|
- spanTag.style.display = "block";
|
|
|
|
|
- });
|
|
|
|
|
- } */
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
//햄버거버튼 : LNB 숨김(전체화면 보기)
|
|
//햄버거버튼 : LNB 숨김(전체화면 보기)
|
|
|
$(document).on("click",".lnbClose",function(){
|
|
$(document).on("click",".lnbClose",function(){
|