From df4d14060f03666aaf33692f9fca30a8ccdcff9a Mon Sep 17 00:00:00 2001 From: igor Date: Mon, 21 Sep 2020 12:10:35 +0600 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=BB=D0=BE=D0=BA=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BA=D1=80=D1=8B?= =?UTF-8?q?=D1=82=D0=B8=D1=8F=20=D0=BE=D0=BA=D0=BD=D0=B0=20tools.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadata/dbms/editrecord.js | 6 +++--- metadata/dbms/login.js | 2 ++ metadata/dbms/showrecord.js | 8 ++++---- metadata/dbms/tools.js | 24 +++++++++++++++--------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/metadata/dbms/editrecord.js b/metadata/dbms/editrecord.js index d68af1c..7fa830e 100644 --- a/metadata/dbms/editrecord.js +++ b/metadata/dbms/editrecord.js @@ -312,7 +312,7 @@ class EdtRec if(nList!=null) { nodeProp.field = new TCheckboxListField(nodeProp.getAttribute("n")); - nCheckbox = nList.firstChild; + let nCheckbox = nList.firstChild; while (nCheckbox!=null) { if(nCheckbox.nodeName=="option") { nodeProp.field.addCheckbox(nCheckbox.getAttribute("n"), nCheckbox.getAttribute("d")); @@ -1513,7 +1513,7 @@ class EdtRec }; } -//Поле с галочкой +//Поле с галочкой (или галочками) class TCheckboxListField { constructor(name) @@ -1529,7 +1529,7 @@ class TCheckboxListField this.array.push(input); input.setAttribute("type", "checkbox"); - input.setAttribute("value", nCheckbox.getAttribute("n")); + input.setAttribute("value", value); var label = document.createElement("Label"); // label.setAttribute("for",id_from_input); diff --git a/metadata/dbms/login.js b/metadata/dbms/login.js index 2aa66b9..9c719ab 100644 --- a/metadata/dbms/login.js +++ b/metadata/dbms/login.js @@ -90,7 +90,9 @@ class DBMSUser if(this.win==null || this.win.closed) { this.win=new TWin(true); + this.win.disableClosing=true; this.win.BuildGUI(10,10); + deleteHTML('TWin_CL_'+this.win.uid); //Удаляю кнопку закрыть this.win.setCaption(trt('Authorization')); this.win.setSize("350px","200px"); diff --git a/metadata/dbms/showrecord.js b/metadata/dbms/showrecord.js index 0a2b75e..f88bacf 100644 --- a/metadata/dbms/showrecord.js +++ b/metadata/dbms/showrecord.js @@ -586,10 +586,10 @@ class SRec let input = document.createElement('input'); input.style.cssText="width: 100%;"; input.setAttribute("type","text"); - input.onkeydown=function(event){ + /*input.onkeydown=function(event){ events = event || window.event; if(events.keyCode==13) events.keyCode=9; - }; + };*/ input.setAttribute("name",columnNode.getAttribute("n")); if(columnNode.getAttribute("size")!=null) input.setAttribute("maxlength",columnNode.getAttribute("size"),0); @@ -632,10 +632,10 @@ class SRec input = document.createElement('input'); input.style.cssText="width: 100%;"; input.setAttribute("type","text"); - input.onkeydown=function(event){ + /*input.onkeydown=function(event){ events = event || window.event; if(events.keyCode==13) events.keyCode=9; - }; + };*/ input.setAttribute("name",columnNode.getAttribute("n")); if(columnNode.getAttribute("size")!=null) input.setAttribute("maxlength",columnNode.getAttribute("size"),0); diff --git a/metadata/dbms/tools.js b/metadata/dbms/tools.js index f63040a..40603d5 100644 --- a/metadata/dbms/tools.js +++ b/metadata/dbms/tools.js @@ -901,13 +901,15 @@ function delChild(obj) * @returns {undefined} */ function applyNodeToNode(first, second, name) -{ - if(first===null || second===null || name ===null) return; +{ + if(first===null || second===null || name ===null){ + console.error("first="+first+" second="+second+" name="+name); + return; + } //Если есть совпадающие узлы то передаём в рекурсию если нет то просто копируем var fn=first.firstChild; while (fn !== null) { - //alert(name+" "+fn.getAttribute("n")); var sn=null; if(fn.nodeName!=="#text" && fn.nodeName!=="#cdata-section" && fn.nodeName!=="#comment"){ //потому что для этих getAttribute вызывает ошибку sn=findNodeOnAttribute(second,fn.nodeName,name,fn.getAttribute(name)); @@ -1266,7 +1268,7 @@ class TWin let str=''; str+=''; - str+=' '; + str+=' '; str+=' '; str+=' '; str+=' '; @@ -1303,8 +1305,12 @@ class TWin this.setSel(); this.div.onmousedown=function(thiz){ return function(e){ thiz.setSel(); } }(this); - - document.getElementById('TWin_CL_'+this.tWinId).onclick=function(win){return function(){ win.Close(); };}(this); //Закрыть окно + //Кнопка закрыть окно + let obj=document.getElementById('TWin_CL_'+this.tWinId); + if(obj!=null){ + //obj.onclick=function(win){return function(){ win.Close(); };}(this); + obj.onclick=(function(){ this.Close(); }).bind(this); + } if(!this.dialog) { @@ -1333,7 +1339,7 @@ class TWin setCaption(val) { - var obj=document.getElementById('TWin_Ca_'+this.tWinId); + let obj=document.getElementById('TWin_Ca_'+this.tWinId); if (typeof val === 'string' || val instanceof String) obj.innerHTML=val; else @@ -1475,7 +1481,7 @@ class TWin //Переместить окно на передний план (Обычно при щелчке на нём) setWinZ(s) { - var i; + let i; this.setZ(Wins.getMaxZ()+2); //+2 это для тени if(s && this.parent!=null) //Переносим текущий элемент в 0й элемент массива детей родительского { @@ -1483,7 +1489,7 @@ class TWin for(i=1;i
'+(this.disableClosing ? '' : '')+'