+Стрелочные функции!

This commit is contained in:
2020-11-12 17:09:03 +06:00
parent 046d957b7d
commit 27d49bf102
8 changed files with 32 additions and 63 deletions

View File

@ -785,11 +785,7 @@ class EdtRec
button.setAttribute("type","button");
button.style.cssText="margin:0px;margin-right:1px;";
button.setAttribute("value",trt('Apply'));
button.onclick=function(thiz){
return function(){
thiz.sendData();
};
}(this);
button.onclick=()=>this.sendData();
td.appendChild( button );
button = document.createElement('input'); //Button cancel
@ -798,7 +794,7 @@ class EdtRec
button.style.cssText="margin:0px;";
button.setAttribute("value",trt('Cancel'));
//button.onclick=function f_exit(this) { alert2(trt('Alert'),this.win.div); }
button.onclick=function(thiz){ return function(){thiz.win.Close();};}(this);
button.onclick=()=>this.win.Close();
td.appendChild( button );
tr.appendChild(td);
eTable.tBodies[0].appendChild(tr);
@ -1485,11 +1481,7 @@ class EdtRec
let readd=document.getElementById("readd_"+this.uid);
if(readd!==null && readd.checked){
//if(!confirm(trt("Successfully_added_data")+".\n"+trt("Add_more")+"?")) this.win.Close();
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",null,function(thiz){return function(){thiz.win.Close();};}(this));
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",null,()=>this.win.Close());
}else
{
this.win.Close();
@ -1499,9 +1491,9 @@ class EdtRec
//The data has been updated successfully now telling the parent to update the record.
updateRows(node)
{
var typeNode=findFirstNode(node,"type");
var typeName=typeNode.getAttribute("n");
var id=typeNode.getAttribute("id");
let typeNode=findFirstNode(node,"type");
let typeName=typeNode.getAttribute("n");
let id=typeNode.getAttribute("id");
if (this.opener!=null)
{
if(this.opener.f_TypeName==typeName) //It would be better to make an array of open windows then check for everyone.