|
|
@@ -147,71 +147,47 @@ function lnbToggle(){
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+//체크박스 전체선택 : 210401
|
|
|
+function uifnAllCheck(el, grpId) {
|
|
|
+ let $thisId = $("#"+grpId);
|
|
|
+ $thisId.find('input').prop("checked", $(el).find("input").is(":checked"));
|
|
|
+ uiChkCount(grpId);
|
|
|
+};
|
|
|
+
|
|
|
+//체크박스 선택된 갯수 출력 : 210401
|
|
|
+function uiChkCount(grpId){
|
|
|
+ let chkLen = $(".chkBox[data-group='"+grpId+"']").find("input:checked").length;//체크된 갯수
|
|
|
+ if( $(".tagNum[data-count='"+grpId+"']") != undefined ){
|
|
|
+ $(".tagNum[data-count='"+grpId+"']").text(chkLen);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
$(document).ready(function(){
|
|
|
|
|
|
//MODELESS POPUP : draggable
|
|
|
$(document).find(".draggable").draggable({containment:"#wrapper", scroll:false});
|
|
|
|
|
|
- //chart resizing
|
|
|
-/* $(window).resize(function(){
|
|
|
- }); */
|
|
|
-
|
|
|
- //체크박스(단일), 라디오버튼 : readOnly 처리
|
|
|
- $(document).on("click", "[type=checkbox][readonly],[type=radio][readonly]", function(){
|
|
|
+ //input readOnly 처리
|
|
|
+ $(document).on("click", "[readonly='readonly']", function(){
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
- $(document).on("click", ".chkBox", function(e){
|
|
|
- if ( !$(this).children("input").is("[disabled]") && !$(this).children("input").is("[readonly]") ) {
|
|
|
-
|
|
|
- let cntId = $(this).parent().parent("ul").attr("data-count-id");
|
|
|
- let cntLen;
|
|
|
-
|
|
|
- if ( $(this).children("input").is('[id]') ){ // ---------------전체선택ID
|
|
|
- let $id = $(this).children("input").attr("id");
|
|
|
- if ( $(this).children("input").is(":checked") ) { //체크된 경우
|
|
|
- $("input[id="+$id+"]").prop("checked", false);
|
|
|
- $("input[name="+$id+"]").prop("checked", false);
|
|
|
- } else {
|
|
|
- $("input[id="+$id+"]").prop("checked", true);
|
|
|
- $("input[name="+$id+"]").prop("checked", true);
|
|
|
- };
|
|
|
- //선택된 개수 출력 (checkBoxList)
|
|
|
- if (cntId != undefined ) {
|
|
|
- cntLen = $("input[name="+$id+"]:checked").length; //체크된 개수
|
|
|
- $("#"+cntId).text(cntLen);
|
|
|
- };
|
|
|
- return false;
|
|
|
-
|
|
|
- } else { // ---------------개별선택
|
|
|
- let $name = $(this).find("input").attr("name");
|
|
|
- let totLen = $("input[name="+$name+"]").length; //전체 개수
|
|
|
- if ( $(this).children("input").is(":checked") ) {
|
|
|
- $(this).find("input").prop("checked", false);
|
|
|
- $("input[id="+$name+"]").prop("checked", false); //전체선택 체크 해제
|
|
|
- } else {
|
|
|
- //$(this).addClass("checked");
|
|
|
- $(this).find("input").prop("checked", true);
|
|
|
- cntLen = $("input[name="+$name+"]:checked").length; //체크된 개수
|
|
|
- if (totLen == cntLen ){
|
|
|
- $("input[id="+$name+"]").prop("checked", true); //전체선택 체크
|
|
|
- }
|
|
|
- };
|
|
|
- //선택된 개수 출력 (checkBoxList)
|
|
|
- if (cntId != undefined ) {
|
|
|
- cntLen = $("input[name="+$name+"]:checked").length; //체크된 개수
|
|
|
- if (totLen > cntLen ) {
|
|
|
- $("#"+cntId).text(cntLen);
|
|
|
- } else if (totLen == cntLen ) {
|
|
|
- $("#"+cntId).text(totLen);
|
|
|
- };
|
|
|
- };
|
|
|
- return false;
|
|
|
- };
|
|
|
+ //그룹내 개별 체크박스 선택 : 210401
|
|
|
+ $(document).on("click", ".chkBox", function(){
|
|
|
+ if( $(this).attr("data-group") ) {
|
|
|
+ let grpId = $(this).attr("data-group");
|
|
|
+ let is_checked = true;
|
|
|
+ let chkLen;
|
|
|
+ $(".chkBox[data-group='"+grpId+"']").each(function(){
|
|
|
+ is_checked = is_checked && $(this).find("input").is(":checked");
|
|
|
+ });
|
|
|
+ $("#"+grpId).find("input[name='전체선택']").prop("checked", is_checked); //전체선택 체크 또는 해제
|
|
|
+ uiChkCount(grpId);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- /* CheckBox List : More(+) 버튼 */
|
|
|
+ //checkBoxList : More(+,-) 버튼
|
|
|
$(document).on("click", ".checkBoxList .more", function(){
|
|
|
var thisI = $(this).find("i");
|
|
|
if( $(thisI).hasClass("fa-plus") ){
|
|
|
@@ -223,19 +199,136 @@ $(document).ready(function(){
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- /* Multi CheckBox - 다중선택 체크박스 */
|
|
|
+ //multiCheckBox : Header Click
|
|
|
$(document).on("click", ".multiCheckBox .sltBtn", function(){
|
|
|
+ //닫기-----
|
|
|
if($(this).hasClass("on")){
|
|
|
- $(this).removeClass("on");
|
|
|
- $(this).parent().find("ul").css({display:"none"});
|
|
|
- }else{
|
|
|
- $(".multiCheckBox .sltBtn").removeClass("on");
|
|
|
- $(".multiCheckBox ul").css({display:"none"});
|
|
|
+ $(this).next("ul").css({display:"none"}); //체크 리스트 닫기
|
|
|
+ let openObj = $(this).parents(".multiCheckBox");
|
|
|
+ let frtTxt = openObj.find("label[data-group] input:checked").parent().eq(0).text();
|
|
|
+ let chkLen = openObj.find("label[data-group] input:checked").length;
|
|
|
+ let chkCnt = chkLen - 1;
|
|
|
+ if ( chkLen == 0 ){ //체크 값이 없을때
|
|
|
+ let btnNm = $(".multiCheckBox .sltBtn.on").attr("data-name");
|
|
|
+ $(this).text(btnNm).removeClass("on");
|
|
|
+ } else if ( chkLen == 1 ) {
|
|
|
+ $(this).text(frtTxt).removeClass("on");
|
|
|
+ } else { //체크 값이 있을때
|
|
|
+ $(this).text(frtTxt + " 외 " +chkCnt).removeClass("on");
|
|
|
+ };
|
|
|
+ }
|
|
|
+ //열기-----
|
|
|
+ else {
|
|
|
+ //활성화된 타 multiCheckBox 처리
|
|
|
+ let openObj = $(".multiCheckBox .sltBtn.on").parents(".multiCheckBox");
|
|
|
+ let frtTxt = openObj.find("label[data-group] input:checked").parent().eq(0).text();
|
|
|
+ let chkLen = openObj.find("label[data-group] input:checked").length;
|
|
|
+ let chkCnt = chkLen - 1;
|
|
|
+ openObj.find("ul").css({display:"none"}); //체크 리스트 닫기
|
|
|
+ if ( chkLen == 0 ){ //체크 값이 없을때
|
|
|
+ let btnNm = $(".multiCheckBox .sltBtn.on").attr("data-name");
|
|
|
+ $(".multiCheckBox .sltBtn.on").text(btnNm).removeClass("on");
|
|
|
+ } else if ( chkLen == 1 ) {
|
|
|
+ $(".multiCheckBox .sltBtn.on").text(frtTxt).removeClass("on");
|
|
|
+ } else { //체크 값이 있을때
|
|
|
+ $(".multiCheckBox .sltBtn.on").text(frtTxt + " 외 " +chkCnt).removeClass("on");
|
|
|
+ };
|
|
|
+ //현재 multiCheckBox 처리
|
|
|
+ $(this).next("ul").css({display:"block"}); //체크 리스트 닫기
|
|
|
$(this).addClass("on");
|
|
|
- $(this).parent().find("ul").css({display:"block"});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ //Focus Out
|
|
|
+ $(document).on("click", function(e){
|
|
|
+ //multiCheckBox----------------------------------------------
|
|
|
+ if ( $(".multiCheckBox") != undefined ) {
|
|
|
+ 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").attr("data-name");
|
|
|
+ $(".multiCheckBox .sltBtn.on").text(btnNm).removeClass("on");
|
|
|
+ } else if ( chkLen == 1 ) {
|
|
|
+ $(".multiCheckBox .sltBtn.on").text(frtTxt).removeClass("on");
|
|
|
+ } else { //체크 값이 있을때
|
|
|
+ $(".multiCheckBox .sltBtn.on").text(frtTxt + " 외 " +chkCnt).removeClass("on");
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //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 숨김(전체화면 보기)
|
|
|
$(document).on("click",".lnbClose",function(){
|
|
|
lnbToggle();
|