From: leon Date: Mon, 27 Jun 2022 06:46:42 +0000 (+0800) Subject: roojs-core.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=eee0f24b8e6c2a3fb081d5463487d90b146a81c2 roojs-core.js roojs-core-debug.js roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js --- diff --git a/roojs-all.js b/roojs-all.js index d84fa00825..b78b9639a2 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2053,8 +2053,8 @@ c0){t+=D;return;}B.push(i);},this);var nc=this.colWidths.length;if(B.length){var C=(nc-B.length)/(1.0*nc); +}}},normalizeWidths:function(A){console.log("htmleditor.BlockTd normalizeWidths");console.log("colWidths 0");console.log(col.Widths[0]);console.log(col.Wdiths[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;return;}this.colWidths[i]+=C},this);this.updateWidths(A); },growColumn:function(){var A=this.toTableArray();this.normalizeWidths(A);var B=this.cellData.col;var nw=this.colWidths[B]*1.2;if(nw>90){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; diff --git a/roojs-debug.js b/roojs-debug.js index 8659665b85..7d89d0948b 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -49561,7 +49561,9 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { normalizeWidths : function(table) { console.log("htmleditor.BlockTd normalizeWidths"); - console.log(this.colWidths); + console.log("colWidths 0"); + console.log(col.Widths[0]); + console.log(col.Wdiths[1]); if (this.colWidths[0] === false) { var nw = 100.0 / this.colWidths.length; diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 012b14fb0d..bdfa81c45e 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -25069,7 +25069,9 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { normalizeWidths : function(table) { console.log("htmleditor.BlockTd normalizeWidths"); - console.log(this.colWidths); + console.log("colWidths 0"); + console.log(col.Widths[0]); + console.log(col.Wdiths[1]); if (this.colWidths[0] === false) { var nw = 100.0 / this.colWidths.length; diff --git a/roojs-ui.js b/roojs-ui.js index 73ef0b6ed4..2675311d2c 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1107,8 +1107,8 @@ c0){t+=D;return;}B.push(i);},this);var nc=this.colWidths.length;if(B.length){var C=(nc-B.length)/(1.0*nc); +}}},normalizeWidths:function(A){console.log("htmleditor.BlockTd normalizeWidths");console.log("colWidths 0");console.log(col.Widths[0]);console.log(col.Wdiths[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;return;}this.colWidths[i]+=C},this);this.updateWidths(A); },growColumn:function(){var A=this.toTableArray();this.normalizeWidths(A);var B=this.cellData.col;var nw=this.colWidths[B]*1.2;if(nw>90){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;