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 2012/03/27 09:44:10 UTC
svn commit: r1305763 -
/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Author: lofwyr
Date: Tue Mar 27 07:44:09 2012
New Revision: 1305763
URL: http://svn.apache.org/viewvc?rev=1305763&view=rev
Log:
TOBAGO-1100: Possibility to register JavaScript functions for initialization of custom HTML parts.
- using jQuery
Modified:
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.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.js?rev=1305763&r1=1305762&r2=1305763&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Tue Mar 27 07:44:09 2012
@@ -78,25 +78,25 @@ var Tobago = {
/**
* the html body object of current page.
- * set via init function (onload attribute of body)
+ * set via init function
*/
page: null,
/**
* The html form object of current page.
- * set via init function (onload attribute of body)
+ * set via init function
*/
form: null,
/**
* The hidden html input object for submitted actionId.
- * set via init function (onload attribute of body)
+ * set via init function
*/
action: null,
/**
* The hidden html input object for the contextPath.
- * set via init function (onload attribute of body)
+ * set via init function
*/
contextPath: null,
@@ -266,15 +266,15 @@ var Tobago = {
}
this.initMarker = true;
- var pageId = jQuery("body").attr("id");
// new LOG.LogArea({hide: false});
// LOG.show();
if (TbgTimer.endBody) { // @DEV_ONLY
TbgTimer.startOnload = new Date(); // @DEV_ONLY
} // @DEV_ONLY
- this.page = this.element(pageId);
- this.form = this.element(this.page.id + this.SUB_COMPONENT_SEP + 'form');
+ var body = jQuery("body");
+ this.page = body.get(0);
+ this.form = body.find("form").get(0); // find() seems to be faster than children()
this.addBindEventListener(this.form, 'submit', this, 'onSubmit');
this.action = this.element(this.page.id + this.SUB_COMPONENT_SEP + 'form-action');
this.contextPath = this.element(this.page.id + this.SUB_COMPONENT_SEP + 'context-path');