From 5f45ee1f42075694765ec58b226877a8157ceff0 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 18 Jan 2024 16:36:46 +0800 Subject: [PATCH] fix column widths docs --- docs/src/Roo_htmleditor_BlockTd.js.html | 17 +++++++++++++---- roojs-all.js | 10 +++++----- roojs-bootstrap-debug.js | 13 +++++++++++-- roojs-bootstrap.js | 10 +++++----- roojs-debug.js | 13 +++++++++++-- roojs-ui-debug.js | 13 +++++++++++-- roojs-ui.js | 10 +++++----- 7 files changed, 61 insertions(+), 25 deletions(-) diff --git a/docs/src/Roo_htmleditor_BlockTd.js.html b/docs/src/Roo_htmleditor_BlockTd.js.html index 55d0376a3b..c84005ee54 100644 --- a/docs/src/Roo_htmleditor_BlockTd.js.html +++ b/docs/src/Roo_htmleditor_BlockTd.js.html @@ -684,8 +684,12 @@ this.colWidths[i] = nw; return; } - this.colWidths[i] += otherAdd - }, this); + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherAdd; + } else { + this.colWidths[i] += otherAdd; + } + }, this); this.updateWidths(table); }, @@ -704,8 +708,13 @@ this.colWidths[i] = nw; return; } - this.colWidths[i] -= otherSub - }, this); + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherSub; + } else { + this.colWidths[i] -= otherSub; + } + + }, this); this.updateWidths(table); }, diff --git a/roojs-all.js b/roojs-all.js index bb6fbb693e..6fdcff4545 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2184,11 +2184,11 @@ r0){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;}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;}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);}}) +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 49765a1f50..0a37793fa2 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -31301,7 +31301,11 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { this.colWidths[i] = nw; return; } - this.colWidths[i] += otherAdd + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherAdd; + } else { + this.colWidths[i] += otherAdd; + } }, this); this.updateWidths(table); @@ -31321,7 +31325,12 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { this.colWidths[i] = nw; return; } - this.colWidths[i] -= otherSub + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherSub; + } else { + this.colWidths[i] -= otherSub; + } + }, this); this.updateWidths(table); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 7c9b1d773a..7b40010823 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1355,11 +1355,11 @@ r0){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;}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;}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);}}) +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 e9e89ecd76..77876a5c14 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -51906,7 +51906,11 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { this.colWidths[i] = nw; return; } - this.colWidths[i] += otherAdd + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherAdd; + } else { + this.colWidths[i] += otherAdd; + } }, this); this.updateWidths(table); @@ -51926,7 +51930,12 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { this.colWidths[i] = nw; return; } - this.colWidths[i] -= otherSub + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherSub; + } else { + this.colWidths[i] -= otherSub; + } + }, this); this.updateWidths(table); diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 92fd717efa..d4047dd39a 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -27404,7 +27404,11 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { this.colWidths[i] = nw; return; } - this.colWidths[i] += otherAdd + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherAdd; + } else { + this.colWidths[i] += otherAdd; + } }, this); this.updateWidths(table); @@ -27424,7 +27428,12 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { this.colWidths[i] = nw; return; } - this.colWidths[i] -= otherSub + if (typeof(this.colWidths[i]) == 'undefined') { + this.colWidths[i] = otherSub; + } else { + this.colWidths[i] -= otherSub; + } + }, this); this.updateWidths(table); diff --git a/roojs-ui.js b/roojs-ui.js index 6c22cde388..4740899e5f 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1237,11 +1237,11 @@ r0){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;}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;}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);}}) +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