From f962645f0f11681a4e2765e3c24389a7e552ecf9 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 18 Jan 2024 16:44:34 +0800 Subject: [PATCH] fix column widths docs --- docs/src/Roo_htmleditor_BlockTd.js.html | 6 ++++++ roojs-all.js | 17 +++++++++-------- roojs-bootstrap-debug.js | 6 ++++++ roojs-bootstrap.js | 17 +++++++++-------- roojs-debug.js | 6 ++++++ roojs-ui-debug.js | 6 ++++++ roojs-ui.js | 17 +++++++++-------- 7 files changed, 51 insertions(+), 24 deletions(-) diff --git a/docs/src/Roo_htmleditor_BlockTd.js.html b/docs/src/Roo_htmleditor_BlockTd.js.html index c84005ee54..6fde687792 100644 --- a/docs/src/Roo_htmleditor_BlockTd.js.html +++ b/docs/src/Roo_htmleditor_BlockTd.js.html @@ -614,7 +614,13 @@ if (this.colWidths[0] != false && table[r][c].colspan > 1) { var el = Roo.htmleditor.Block.factory(table[r][c].cell); var width = 0; + var lv = false; for(var i = 0; i < table[r][c].colspan; i ++) { + if (typeof(this.colWidths[c + i]) != 'undefined') { + lv = this.colWidths[c + i]; + } else { + this.colWidths[c + i] = lv; + } width += Math.floor(this.colWidths[c + i]); } el.width = width +'%'; diff --git a/roojs-all.js b/roojs-all.js index 6fdcff4545..0720fcfa85 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2181,14 +2181,15 @@ c1){var el=Roo.htmleditor.Block.factory(A[r][c].cell); -var B=0;for(var i=0;i0){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(){var A=this.toTableArray();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;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{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; -return;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{this.colWidths[i]-=C;}},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray();for(var i=0;i1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1);this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i1){c.colspan--;c.cell.setAttribute('colspan',c.colspan);}A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}}) +var B=0;var lv=false;for(var i=0;i0){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(){var A=this.toTableArray(); +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;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C; +}else{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;return;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{this.colWidths[i]-=C;}},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray();for(var i=0; +i1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1); +this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i1){c.colspan--;c.cell.setAttribute('colspan',c.colspan); +}A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}}) // Roo/HtmlEditorCore.js Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resize:false,height:300,width:500,autoClean:true,enableBlocks:true,stylesheets:false,language:'en',allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',undoManager:false,getDocMarkup:function(){var st=''; if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 0a37793fa2..f1ce730c9a 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -31231,7 +31231,13 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { if (this.colWidths[0] != false && table[r][c].colspan > 1) { var el = Roo.htmleditor.Block.factory(table[r][c].cell); var width = 0; + var lv = false; for(var i = 0; i < table[r][c].colspan; i ++) { + if (typeof(this.colWidths[c + i]) != 'undefined') { + lv = this.colWidths[c + i]; + } else { + this.colWidths[c + i] = lv; + } width += Math.floor(this.colWidths[c + i]); } el.width = width +'%'; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 7b40010823..127a61beb9 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1352,14 +1352,15 @@ c1){var el=Roo.htmleditor.Block.factory(A[r][c].cell); -var B=0;for(var i=0;i0){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(){var A=this.toTableArray();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;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{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; -return;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{this.colWidths[i]-=C;}},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray();for(var i=0;i1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1);this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i1){c.colspan--;c.cell.setAttribute('colspan',c.colspan);}A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}}) +var B=0;var lv=false;for(var i=0;i0){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(){var A=this.toTableArray(); +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;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C; +}else{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;return;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{this.colWidths[i]-=C;}},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray();for(var i=0; +i1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1); +this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i1){c.colspan--;c.cell.setAttribute('colspan',c.colspan); +}A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}}) // Roo/HtmlEditorCore.js Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resize:false,height:300,width:500,autoClean:true,enableBlocks:true,stylesheets:false,language:'en',allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',undoManager:false,getDocMarkup:function(){var st=''; if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom); diff --git a/roojs-debug.js b/roojs-debug.js index 77876a5c14..d2f4c6973c 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -51836,7 +51836,13 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { if (this.colWidths[0] != false && table[r][c].colspan > 1) { var el = Roo.htmleditor.Block.factory(table[r][c].cell); var width = 0; + var lv = false; for(var i = 0; i < table[r][c].colspan; i ++) { + if (typeof(this.colWidths[c + i]) != 'undefined') { + lv = this.colWidths[c + i]; + } else { + this.colWidths[c + i] = lv; + } width += Math.floor(this.colWidths[c + i]); } el.width = width +'%'; diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index d4047dd39a..25a2ef0ba0 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -27334,7 +27334,13 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { if (this.colWidths[0] != false && table[r][c].colspan > 1) { var el = Roo.htmleditor.Block.factory(table[r][c].cell); var width = 0; + var lv = false; for(var i = 0; i < table[r][c].colspan; i ++) { + if (typeof(this.colWidths[c + i]) != 'undefined') { + lv = this.colWidths[c + i]; + } else { + this.colWidths[c + i] = lv; + } width += Math.floor(this.colWidths[c + i]); } el.width = width +'%'; diff --git a/roojs-ui.js b/roojs-ui.js index 4740899e5f..5126a44de0 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1234,14 +1234,15 @@ c1){var el=Roo.htmleditor.Block.factory(A[r][c].cell); -var B=0;for(var i=0;i0){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(){var A=this.toTableArray();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;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{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; -return;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{this.colWidths[i]-=C;}},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray();for(var i=0;i1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1);this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i1){c.colspan--;c.cell.setAttribute('colspan',c.colspan);}A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}}) +var B=0;var lv=false;for(var i=0;i0){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(){var A=this.toTableArray(); +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;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C; +}else{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;return;}if(typeof(this.colWidths[i])=='undefined'){this.colWidths[i]=C;}else{this.colWidths[i]-=C;}},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray();for(var i=0; +i1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1); +this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i1){c.colspan--;c.cell.setAttribute('colspan',c.colspan); +}A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}}) // Roo/HtmlEditorCore.js Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resize:false,height:300,width:500,autoClean:true,enableBlocks:true,stylesheets:false,language:'en',allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',undoManager:false,getDocMarkup:function(){var st=''; if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom); -- 2.39.2