Author: nbelaevski
Date: 2008-01-07 14:49:18 -0500 (Mon, 07 Jan 2008)
New Revision: 5159
Modified:
trunk/framework/impl/src/main/javascript/prototype/patches.js
trunk/framework/impl/src/main/javascript/prototype/prototype1.6.0.js
Log:
http://jira.jboss.com/jira/browse/RF-1487
Modified: trunk/framework/impl/src/main/javascript/prototype/patches.js
===================================================================
--- trunk/framework/impl/src/main/javascript/prototype/patches.js 2008-01-06 15:07:25 UTC
(rev 5158)
+++ trunk/framework/impl/src/main/javascript/prototype/patches.js 2008-01-07 19:49:18 UTC
(rev 5159)
@@ -78,12 +78,13 @@
for (var eventName in cache) {
var wrappers = cache[eventName];
+ var domEventName = Event.getDOMEventName(eventName);
wrappers.each(function(wrapper) {
if (node.removeEventListener) {
- node.removeEventListener(eventName, wrapper, false);
+ node.removeEventListener(domEventName, wrapper, false);
} else {
- node.detachEvent("on" + eventName, wrapper);
+ node.detachEvent("on" + domEventName, wrapper);
}
});
@@ -92,6 +93,11 @@
delete Event.cache[eventID];
}
+
+ var component = node.component;
+ if (component && component.destroy) {
+ component.destroy();
+ }
}
Event.unloadElementsCache = function(oldNode) {
Modified: trunk/framework/impl/src/main/javascript/prototype/prototype1.6.0.js
===================================================================
--- trunk/framework/impl/src/main/javascript/prototype/prototype1.6.0.js 2008-01-06
15:07:25 UTC (rev 5158)
+++ trunk/framework/impl/src/main/javascript/prototype/prototype1.6.0.js 2008-01-07
19:49:18 UTC (rev 5159)
@@ -3805,6 +3805,12 @@
}
})();
+//added by nick
+Event.getDOMEventName = function(eventName) {
+ if (eventName && eventName.include(':')) return
"dataavailable";
+ return eventName;
+};
+
Object.extend(Event, (function() {
var cache = Event.cache;
@@ -3814,10 +3820,12 @@
return element._eventID = ++arguments.callee.id;
}
- function getDOMEventName(eventName) {
- if (eventName && eventName.include(':')) return
"dataavailable";
- return eventName;
- }
+// commented by nick
+//
+// function getDOMEventName(eventName) {
+// if (eventName && eventName.include(':')) return
"dataavailable";
+// return eventName;
+// }
function getCacheForID(id) {
return cache[id] = cache[id] || { };
@@ -3873,7 +3881,7 @@
return {
observe: function(element, eventName, handler) {
element = $(element);
- var name = getDOMEventName(eventName);
+ var name = Event.getDOMEventName(eventName);
var wrapper = createWrapper(element, eventName, handler);
if (!wrapper) return element;
@@ -3889,7 +3897,7 @@
stopObserving: function(element, eventName, handler) {
element = $(element);
- var id = getEventID(element), name = getDOMEventName(eventName);
+ var id = getEventID(element), name = Event.getDOMEventName(eventName);
if (!handler && eventName) {
getWrappersForEventName(id, eventName).each(function(wrapper) {