Author: pyaschenko
Date: 2008-04-24 12:05:46 -0400 (Thu, 24 Apr 2008)
New Revision: 8135
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
http://jira.jboss.com/jira/browse/RF-2022
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
---
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-24
15:42:17 UTC (rev 8134)
+++
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-24
16:05:46 UTC (rev 8135)
@@ -762,6 +762,7 @@
obj=obj.nextSibling;
obj.component = this;
obj.richfacesComponent="richfaces:calendar";
+ this["rich:destructor"] = "destructor";
// memory leaks fix
obj = null;
@@ -784,6 +785,14 @@
},
+ destructor: function()
+ {
+ if (this.params.popup && this.isVisible)
+ {
+ Event.stopObserving(window.document, "click", this.eventOnCollapse, false);
+ }
+ },
+
dateEditorSelectYear: function(value)
{
if (this.dateEditorYearID)
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
===================================================================
---
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2008-04-24
15:42:17 UTC (rev 8134)
+++
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2008-04-24
16:05:46 UTC (rev 8135)
@@ -18,6 +18,12 @@
destroy: function()
{
+ if (this.doingDrag)
+ {
+ Event.stopObserving(document, 'mousemove', this.boundDoDrag);
+ Event.stopObserving(document, 'mouseup', this.boundEndDrag);
+ }
+
Event.stopObserving(this.id, 'mousedown', this.boundStartDrag);
this.modalPanel=null;
},
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
---
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2008-04-24
15:42:17 UTC (rev 8134)
+++
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2008-04-24
16:05:46 UTC (rev 8135)
@@ -107,6 +107,10 @@
destroy: function()
{
+ if (!this.parentAttached && !this.disabled) {
+ Event.stopObserving(document, "mousemove", this.attachOnLoadEventsListner,
true);
+ }
+
if (this.toolTip) {
this.toolTip.component = null;
}
Modified:
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js
===================================================================
---
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js 2008-04-24
15:42:17 UTC (rev 8134)
+++
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js 2008-04-24
16:05:46 UTC (rev 8135)
@@ -12,6 +12,11 @@
this.eventPreventLostFocus = this.processPreventLostFocus.bindAsEventListener(this);
Event.observe(this.tree.element, "click", this.eventPreventLostFocus);
},
+
+ destroy: function() {
+ Event.stopObserving(document, "keydown", this.eventKeyPress);
+ Event.stopObserving(document, "click", this.eventLostFocus);
+ },
restoreSelection: function() {
if (this.tree.input.value)
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
---
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-04-24
15:42:17 UTC (rev 8134)
+++
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-04-24
16:05:46 UTC (rev 8135)
@@ -31,6 +31,7 @@
this.oncollapse = new Function('event', (events.oncollapse ? events.oncollapse
: "") + "; return true;");
this.onAjaxSelect = onAjaxSelect;
this.element = $(id);
+ this.element.component=this;
this.inputId = input;
this.input = $(this.inputId);
this.toggleOnClick = toggleOnClick;
@@ -48,6 +49,8 @@
this.selectionManager = new Tree.SelectionManager(this);
this.selectionManager.restoreSelection();
+
+ this["rich:destructor"] = "destroy";
Event.observe(this.element, "click", function(event) {
if (Richfaces.eventIsSynthetic(event)) {
@@ -108,6 +111,11 @@
}
}.bindAsEventListener(this));
},
+
+ destroy: function() {
+ this.selectionManager.destroy();
+ this.element.component=null;
+ },
getElements: function(ajaxUpdate) {
this.elements.contentTd = $(this.id +