Author: nbelaevski
Date: 2010-11-03 15:16:57 -0400 (Wed, 03 Nov 2010)
New Revision: 19915
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
https://jira.jboss.org/browse/RF-9343
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-11-03 15:01:37
UTC (rev 19914)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-11-03 19:16:57
UTC (rev 19915)
@@ -770,10 +770,21 @@
};
- // move this code to somewhere
- if (typeof jsf != 'undefined') {
- jsf.ajax.addOnEvent(ajaxOnComplete);
+ var attachAjaxDOMCleaner = function() {
+ // move this code to somewhere
+ if (typeof jsf != 'undefined' && jsf.ajax) {
+ jsf.ajax.addOnEvent(ajaxOnComplete);
+
+ return true;
+ }
+
+ return false;
+ };
+
+ if (!attachAjaxDOMCleaner()) {
+ jQuery(document).ready(attachAjaxDOMCleaner);
}
+
if (window.addEventListener) {
window.addEventListener("unload", richfaces.cleanDom, false);
} else {