Roo/htmleditor/BlockTd.js
authorleon <leon@roojs.com>
Mon, 27 Jun 2022 06:51:42 +0000 (14:51 +0800)
committerleon <leon@roojs.com>
Mon, 27 Jun 2022 06:51:42 +0000 (14:51 +0800)
roojs-core.js
roojs-core-debug.js
roojs-ui.js
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

Roo/htmleditor/BlockTd.js
roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index a9523de..51888ca 100644 (file)
@@ -627,7 +627,7 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, {
         console.log("colWidths 0");
         console.log(this.colWidths[0]);
         console.log("colWidths 1");
-        console.log(this.colWdiths[1]);
+        console.log(this.colWidths[1]);
     
         if (this.colWidths[0] === false) {
             var nw = 100.0 / this.colWidths.length;
index 5d88343..b8dd7f7 100644 (file)
@@ -2053,7 +2053,7 @@ c<cd.col+cd.colspan;c++){if(r==cd.row&&c==cd.col){this.node.removeAttribute('row
 },redrawAllCells:function(A){var B=this.node.closest('tr').closest('table');var C=B.rows[0].parentNode;Array.from(B.rows).forEach(function(r,ri){Array.from(r.cells).forEach(function(ce,ci){ce.parentNode.removeChild(ce);});r.parentNode.removeChild(r);});for(var r=0;
 r<A.length;r++){var re=B.rows[r];var re=B.ownerDocument.createElement('tr');C.appendChild(re);for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}re.appendChild(A[r][c].cell);A[r][c].cell=false;}}},updateWidths:function(A){for(var r=0;r<A.length;
 r++){for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}if(this.colWidths[0]!=false&&A[r][c].colspan<2){var el=Roo.htmleditor.Block.factory(A[r][c].cell);el.width=Math.floor(this.colWidths[c])+'%';el.updateElement(el.node);}A[r][c].cell=false;
-}}},normalizeWidths:function(A){console.log("htmleditor.BlockTd normalizeWidths");console.log("colWidths 0");console.log(this.colWidths[0]);console.log("colWidths 1");console.log(this.colWdiths[1]);if(this.colWidths[0]===false){var nw=100.0/this.colWidths.length;
+}}},normalizeWidths:function(A){console.log("htmleditor.BlockTd normalizeWidths");console.log("colWidths 0");console.log(this.colWidths[0]);console.log("colWidths 1");console.log(this.colWidths[1]);if(this.colWidths[0]===false){var nw=100.0/this.colWidths.length;
 this.colWidths.forEach(function(w,i){this.colWidths[i]=nw;},this);return;}var t=0,B=[];this.colWidths.forEach(function(w,i){this.colWidths[i]=this.colWidths[i]==''?0:(this.colWidths[i]+'').replace(/[^0-9]+/g,'')*1;var D=this.colWidths[i];if(D>0){t+=D;return;
 }B.push(i);},this);var nc=this.colWidths.length;if(B.length){var C=(nc-B.length)/(1.0*nc);var t=C*t;var ew=(100-t)/(1.0*B.length);this.colWidths.forEach(function(w,i){if(w>0){this.colWidths[i]=w*C;return;}this.colWidths[i]=ew;},this);}},shrinkColumn:function(){console.log("htmleditor.BlockTd shrinkColumn");
 var A=this.toTableArray();console.log(A);this.normalizeWidths(A);var B=this.cellData.col;var nw=this.colWidths[B]*0.8;if(nw<5){return;}var C=(this.colWidths[B]*0.2)/(this.colWidths.length-1);this.colWidths.forEach(function(w,i){if(i==B){this.colWidths[i]=nw;
index 38edd23..4996282 100644 (file)
@@ -49564,7 +49564,7 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, {
         console.log("colWidths 0");
         console.log(this.colWidths[0]);
         console.log("colWidths 1");
-        console.log(this.colWdiths[1]);
+        console.log(this.colWidths[1]);
     
         if (this.colWidths[0] === false) {
             var nw = 100.0 / this.colWidths.length;
index 9b1962d..0f7d569 100644 (file)
@@ -25072,7 +25072,7 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, {
         console.log("colWidths 0");
         console.log(this.colWidths[0]);
         console.log("colWidths 1");
-        console.log(this.colWdiths[1]);
+        console.log(this.colWidths[1]);
     
         if (this.colWidths[0] === false) {
             var nw = 100.0 / this.colWidths.length;
index cea4523..5aa4ef2 100644 (file)
@@ -1107,7 +1107,7 @@ c<cd.col+cd.colspan;c++){if(r==cd.row&&c==cd.col){this.node.removeAttribute('row
 },redrawAllCells:function(A){var B=this.node.closest('tr').closest('table');var C=B.rows[0].parentNode;Array.from(B.rows).forEach(function(r,ri){Array.from(r.cells).forEach(function(ce,ci){ce.parentNode.removeChild(ce);});r.parentNode.removeChild(r);});for(var r=0;
 r<A.length;r++){var re=B.rows[r];var re=B.ownerDocument.createElement('tr');C.appendChild(re);for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}re.appendChild(A[r][c].cell);A[r][c].cell=false;}}},updateWidths:function(A){for(var r=0;r<A.length;
 r++){for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}if(this.colWidths[0]!=false&&A[r][c].colspan<2){var el=Roo.htmleditor.Block.factory(A[r][c].cell);el.width=Math.floor(this.colWidths[c])+'%';el.updateElement(el.node);}A[r][c].cell=false;
-}}},normalizeWidths:function(A){console.log("htmleditor.BlockTd normalizeWidths");console.log("colWidths 0");console.log(this.colWidths[0]);console.log("colWidths 1");console.log(this.colWdiths[1]);if(this.colWidths[0]===false){var nw=100.0/this.colWidths.length;
+}}},normalizeWidths:function(A){console.log("htmleditor.BlockTd normalizeWidths");console.log("colWidths 0");console.log(this.colWidths[0]);console.log("colWidths 1");console.log(this.colWidths[1]);if(this.colWidths[0]===false){var nw=100.0/this.colWidths.length;
 this.colWidths.forEach(function(w,i){this.colWidths[i]=nw;},this);return;}var t=0,B=[];this.colWidths.forEach(function(w,i){this.colWidths[i]=this.colWidths[i]==''?0:(this.colWidths[i]+'').replace(/[^0-9]+/g,'')*1;var D=this.colWidths[i];if(D>0){t+=D;return;
 }B.push(i);},this);var nc=this.colWidths.length;if(B.length){var C=(nc-B.length)/(1.0*nc);var t=C*t;var ew=(100-t)/(1.0*B.length);this.colWidths.forEach(function(w,i){if(w>0){this.colWidths[i]=w*C;return;}this.colWidths[i]=ew;},this);}},shrinkColumn:function(){console.log("htmleditor.BlockTd shrinkColumn");
 var A=this.toTableArray();console.log(A);this.normalizeWidths(A);var B=this.cellData.col;var nw=this.colWidths[B]*0.8;if(nw<5){return;}var C=(this.colWidths[B]*0.2)/(this.colWidths.length-1);this.colWidths.forEach(function(w,i){if(i==B){this.colWidths[i]=nw;