You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/07/11 12:06:13 UTC

svn commit: r1609669 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Author: lofwyr
Date: Fri Jul 11 10:06:13 2014
New Revision: 1609669

URL: http://svn.apache.org/r1609669
Log:
TOBAGO-1413: Wrong size calucation after column resizing in sheet

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1609669&r1=1609668&r2=1609669&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Fri Jul 11 10:06:13 2014
@@ -358,7 +358,12 @@ Tobago.Sheet.setup2 = function (sheets) 
         var headerList = headerTable.find("col");
         var bodyList = bodyTable.find("col");
         var widths = ",";
-        for (var i = 0; i < headerList.length; i++) {
+        var oldWidthList = [];
+        var i;
+        for (i = 0; i < bodyList.length; i++) {
+          oldWidthList[i] = bodyList.eq(i).width();
+        }
+        for (i = 0; i < headerList.length; i++) {
           var newWidth = headerList.eq(i).width();
           // for the hidden field
           widths = widths + newWidth + ",";
@@ -370,7 +375,7 @@ Tobago.Sheet.setup2 = function (sheets) 
             // reset the width inside of the cells (TD) if the value was changed.
             var tds = jQuery("td:nth-child(" + (i + 1) + ")", bodyTable);
             if (tds.size() > 0) {
-              var innerWidth = tds.children().eq(0).width() - oldWidth + newWidth;
+              var innerWidth = tds.children().eq(0).width() - oldWidthList[i] + newWidth;
               // setting all sizes of the inner cells to the same value
               tds.children().width(innerWidth);
               // XXX later, if we have box-sizing: border-box we can set the width to 100%