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 2006/05/02 10:47:32 UTC
svn commit: r398867 - in
/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script:
tobago-sheet.js tobago.js
Author: weber
Date: Tue May 2 01:47:22 2006
New Revision: 398867
URL: http://svn.apache.org/viewcvs?rev=398867&view=rev
Log:
fix in js (sheet without header)
Modified:
myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=398867&r1=398866&r2=398867&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Tue May 2 01:47:22 2006
@@ -309,9 +309,11 @@
Tobago.Sheet.prototype.setupResizer = function() {
var i = 0;
var headerDiv = Tobago.element(this.headerDivId);
+ if (headerDiv) {
+ Tobago.addBindEventListener(headerDiv, "mousemove", this, "doResize");
+ Tobago.addBindEventListener(headerDiv, "mouseup", this, "endResize");
+ }
var contentDiv = Tobago.element(this.contentDivId)
- Tobago.addBindEventListener(headerDiv, "mousemove", this, "doResize");
- Tobago.addBindEventListener(headerDiv, "mouseup", this, "endResize");
Tobago.addBindEventListener(contentDiv, "scroll", this, "doScroll");
var resizer = Tobago.element(this.id + "_header_resizer_" + i++ );
while (resizer) {
@@ -564,6 +566,9 @@
Tobago.Sheet.prototype.adjustHeaderDiv = function () {
var headerDiv = Tobago.element(this.headerDivId);
+ if (!headerDiv) {
+ return;
+ }
var contentDiv = Tobago.element(this.contentDivId);
var contentTable = contentDiv.getElementsByTagName("table")[0];
contentTable.style.width = "10px";
@@ -678,8 +683,10 @@
Tobago.Sheet.prototype.doScroll = function(event) {
//LOG.debug("header / data " + this.headerDiv.scrollLeft + "/" + this.contentDiv.scrollLeft);
- Tobago.element(this.headerDivId).scrollLeft
- = Tobago.element(this.contentDivId).scrollLeft;
+ var headerDiv = Tobago.element(this.headerDivId);
+ if (headerDiv) {
+ headerDiv.scrollLeft = Tobago.element(this.contentDivId).scrollLeft;
+ }
//LOG.debug("header / data " + this.headerDiv.scrollLeft + "/" + this.contentDiv.scrollLeft);
//LOG.debug("----------------------------------------------");
};
Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=398867&r1=398866&r2=398867&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Tue May 2 01:47:22 2006
@@ -894,9 +894,12 @@
if (element.removeEventListener) { // this is DOM2
element.removeEventListener(event, myFunction, true);
}
- else { // IE
+ else if (element.detachEvent) { // IE
element.detachEvent("on" + event, myFunction);
+ } else {
+ LOG.debug("Unknown Element :" + typeof element);
}
+
},
/**