Author: yradtsevich
Date: 2010-09-29 05:46:44 -0400 (Wed, 29 Sep 2010)
New Revision: 25291
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
Log:
JBIDE-7198
https://jira.jboss.org/browse/JBIDE-7198 : DnD in VPE starts while using
scrollbars
- resolved: handling of 'dragstart' event is moved from document to content area
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-09-29
09:37:51 UTC (rev 25290)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-09-29
09:46:44 UTC (rev 25291)
@@ -96,6 +96,11 @@
contentArea.addEventListener(MozillaEventAdapter.MOUSEMOVEEVENTTYPE, this, false);
contentArea.addEventListener(MozillaEventAdapter.CONTEXTMENUEVENTTYPE, this, false);
contentArea.addEventListener(MozillaEventAdapter.DBLCLICK, this, false);
+
+ /* yradtsevich: JBIDE-7198: 'dragstart' event has to be added
+ * just to contentArea, rather than to document. Otherwise
+ * the event is fired also on the scrollbars. */
+ contentArea.addEventListener(MozillaEventAdapter.DRAGSTART, this, false);
}
if (window != null) {
window.addEventListener(MozillaEventAdapter.MOZAFTERPAINT, this, false);
@@ -109,7 +114,6 @@
document.addEventListener(MozillaEventAdapter.DRAGENTEREVENT, this, false);
document.addEventListener(MozillaEventAdapter.DRAGEND,this, false);
document.addEventListener(MozillaEventAdapter.DRAGEXITEVENT,this, false);
- document.addEventListener(MozillaEventAdapter.DRAGSTART, this, false);
document.addEventListener(MozillaEventAdapter.DRAGOVEREVENT, this, false);
document.addEventListener(MozillaEventAdapter.KEYPRESS, this, false);
@@ -132,6 +136,9 @@
contentArea.removeEventListener(MozillaEventAdapter.MOUSEMOVEEVENTTYPE, this, false);
contentArea.removeEventListener(MozillaEventAdapter.CONTEXTMENUEVENTTYPE, this,
false);
contentArea.removeEventListener(MozillaEventAdapter.DBLCLICK, this, false);
+
+ contentArea.removeEventListener(MozillaEventAdapter.DRAGSTART, this, false);
+
contentArea = null;
}
if (document != null) {
@@ -139,7 +146,6 @@
document.removeEventListener(MozillaEventAdapter.DRAGENTEREVENT, this, false);
document.removeEventListener(MozillaEventAdapter.DRAGEND, this, false);
document.removeEventListener(MozillaEventAdapter.DRAGEXITEVENT, this, false);
- document.removeEventListener(MozillaEventAdapter.DRAGSTART, this, false);
document.removeEventListener(MozillaEventAdapter.DRAGOVEREVENT, this, false);
document.removeEventListener(MozillaEventAdapter.KEYPRESS, this, false);