diff --git a/src/main/webapp/resources/js/fims/cmmn/customElements.js b/src/main/webapp/resources/js/fims/cmmn/customElements.js index edb41d0c..261073ea 100644 --- a/src/main/webapp/resources/js/fims/cmmn/customElements.js +++ b/src/main/webapp/resources/js/fims/cmmn/customElements.js @@ -61,7 +61,9 @@ class NameLabel extends HTMLLabelElement { } if(doctx != null){ this.setAttribute("data-ref-doctx", doctx); - this.htmlFor = this.getAttribute("for")+"--"+doctx; + if(this.getAttribute("for") != null && this.getAttribute("for").indexOf("--") == -1){ + this.htmlFor = this.getAttribute("for")+"--"+doctx; + } } } } @@ -177,17 +179,19 @@ class CurlyBrackets extends HTMLTemplateElement { constructor() { super(); + let curlyBracketsOpen = String.fromCharCode(123); //중괄호시작 + let thisCon = this.content; let trs = thisCon.querySelectorAll("tr"); trs.forEach(function(node) { let key = node.getAttribute("data-key"); - if(key != null && key != "" && key.indexOf("{") == -1){ + if(key != null && key != "" && key.indexOf(curlyBracketsOpen) == -1){ node.setAttribute("data-key","{"+key+"}"); } let index = node.getAttribute("data-index"); - if(index != null && index != "" && index.indexOf("{") == -1){ + if(index != null && index != "" && index.indexOf(curlyBracketsOpen) == -1){ node.setAttribute("data-index","{"+index+"}"); } }); @@ -201,8 +205,8 @@ class CurlyBrackets extends HTMLTemplateElement { if(node.getAttribute("ondblclick") != null && node.getAttribute("ondblclick") == ""){ node.setAttribute("ondblclick","{ondblclick}"); } - - if(node.textContent.trim() != "" && node.textContent.indexOf("{") == -1){ + + if(node.textContent.trim() != "" && node.textContent.indexOf(curlyBracketsOpen) == -1){ node.textContent = "{"+node.textContent.trim()+"}"; } }); diff --git a/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js b/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js index 22897da2..6f183df0 100644 --- a/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js +++ b/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js @@ -80,7 +80,8 @@ function ObjectInspector(doctx, data){ } else if(data instanceof HTMLScriptElement){ objectInspector = JSON.parse(data.text); } else if(typeof data == "string"){ - if(!data.trim().startsWith(String.fromCharCode(123))){ + let curlyBracketsOpen = String.fromCharCode(123); //중괄호시작 + if(!data.trim().startsWith(curlyBracketsOpen)){ objectInspector = JSON.parse(document.querySelector("script[id='"+data+"'").text); } else { objectInspector = JSON.parse(data);