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 2011/11/21 10:47:09 UTC

svn commit: r1204417 - /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: Mon Nov 21 09:47:09 2011
New Revision: 1204417

URL: http://svn.apache.org/viewvc?rev=1204417&view=rev
Log:
TOBAGO-1003: JavaScript for the Sheet
 - Using the width attribute instead of the width style
 - jQuery: Using "closest" instead of "parents" with ":first"
 - IE6/7 fix was not correct (multiply 2)

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=1204417&r1=1204416&r2=1204417&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 Mon Nov 21 09:47:09 2011
@@ -744,7 +744,7 @@ Tobago.Sheet.prototype.endResize = funct
       var columnNr = this.resizerId.substring(this.resizerId.lastIndexOf("_") + 1, this.resizerId.length);
       var table = jQuery(Tobago.Utils.escapeClientId(this.id) + ">div>table");
       var col = jQuery("colgroup>col", table).eq(columnNr);
-      col.width(width);
+      col.attr("width", width);
 
       if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 7) {
         Tobago.Sheet.fixIE67ColWidth(col);
@@ -772,9 +772,9 @@ Tobago.Sheet.prototype.endResize = funct
  * @param col A jQuery object
  */
 Tobago.Sheet.fixIE67ColWidth = function(col) {
-  var td = col.parents("table:first").children("tbody").children("tr:first").children("td").eq(col.index());
+  var td = col.closest("table").children("tbody").children("tr:first").children("td").eq(col.index());
   var delta = td.outerWidth() - td.width();
-  col.width(col.width() - delta * 2);
+  col.attr("width", col.attr("width") - delta);
 };
 
 Tobago.Sheet.prototype.storeSizes = function() {