Author: pyaschenko
Date: 2010-12-16 06:26:15 -0500 (Thu, 16 Dec 2010)
New Revision: 20605
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
cleanup fix: call destroy method correctly
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-16 10:43:45
UTC (rev 20604)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-16 11:26:15
UTC (rev 20605)
@@ -33,7 +33,7 @@
}
}
return element;
- }
+ };
// get RichFaces component object by component id or DOM element or jQuery object
richfaces.$ = function (source) {
@@ -42,7 +42,7 @@
if (element) {
return (element[richfaces.RICH_CONTAINER] || {})["component"];
}
- }
+ };
richfaces.$$ = function(componentName, element)
{
@@ -53,25 +53,23 @@
else
element = element.parentNode;
}
- }
+ };
// find component and call his method
richfaces.invokeMethod = function(source, method) {
- var c = richfaces.$(source);
- if (c) {
- var f = c[method];
- if (typeof f == "function") {
- return f.apply(c, Array.prototype.slice.call(arguments, 2));
- }
+ var c = richfaces.$(source);
+ var f;
+ if (c && typeof (f=c[method]) == "function") {
+ return f.apply(c, Array.prototype.slice.call(arguments, 2));
}
- }
+ };
//dom cleaner
richfaces.cleanComponent = function (source) {
var component = richfaces.$(source);
if (component) {
- richfaces.invokeMethod(component, "destroy");
- richfaces.invokeMethod(component, "detach", source);
+ component.destroy();
+ component.detach(source);
}
};
@@ -88,7 +86,7 @@
richfaces.cleanComponent(e);
}
}
- }
+ };
//form.js
richfaces.submitForm = function(form, parameters, target) {
Show replies by date