You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2013/08/26 10:12:16 UTC
svn commit: r1517456 -
/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
Author: weber
Date: Mon Aug 26 08:12:16 2013
New Revision: 1517456
URL: http://svn.apache.org/r1517456
Log:
TOBAGO-1303 - sheet looses scroll position after refresh
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=1517456&r1=1517455&r2=1517456&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 Aug 26 08:12:16 2013
@@ -364,14 +364,15 @@ Tobago.Sheet.setup2 = function (sheets)
// scrolling
jQuery(sheets).find(".tobago-sheet-body").bind("scroll", function () {
- var scrollLeft = jQuery(this).prop("scrollLeft");
- var scrollTop = jQuery(this).prop("scrollTop");
+ var sheetBody = jQuery(this);
+ var scrollLeft = sheetBody.prop("scrollLeft");
+ var scrollTop = sheetBody.prop("scrollTop");
// scrolling the table should move the header
- jQuery(this).siblings(".tobago-sheet-headerDiv").prop("scrollLeft", scrollLeft);
+ sheetBody.siblings(".tobago-sheet-headerDiv").prop("scrollLeft", scrollLeft);
// store the position in a hidden field
- var hidden = Tobago.Sheet.hidden(jQuery(this).parent(), "scrollPosition");
+ var hidden = Tobago.Sheet.hidden(sheetBody.parent(), "scrollPosition");
hidden.val(scrollLeft + ";" + scrollTop);
});
@@ -388,13 +389,10 @@ Tobago.Sheet.setup2 = function (sheets)
if (sep != -1) {
var scrollLeft = hidden.val().substr(0, sep);
var scrollTop = hidden.val().substr(sep + 1);
- sheet.children(".tobago-sheet-body").css({
- "scroll-left": scrollLeft,
- "scroll-top": scrollTop
- });
- sheet.children(".tobago-sheet-headerDiv").css({
- "scroll-left": scrollLeft
- });
+ var body = sheet.children(".tobago-sheet-body");
+ body.prop("scrollLeft", scrollLeft);
+ body.prop("scrollTop", scrollTop);
+ sheet.children(".tobago-sheet-headerDiv").prop("scrollLeft", scrollLeft);
}
});