koggdal/ocanvas — Issue #18: DragAndDrop seems to delete unrelated events
Author: sluxor
Created: 2011-12-01 12:39:44+00:00
State: open

When I execute dragAndDrop(false) on multiple elements oCanvas will delete unrelated events.
I've created a detailled example which demonstrates the problem:

```

Unsupported Browser

This file demonstrates the bug in oCanvas.

It works as following:

I create two different objects and enable them for dragAndDrop

I add an canvas-wide mousedown event (canvas.bind)

In this mousedown event I disable the dragAndDrop for both draggable elements

Depending on the order of the disablement the oCanvas library also deletes the canvas-wide mousedown event

With ENABLE_BUG set to false you will see that the mousedown event will be called again (expected). While set to true you will only see one alert..

Note: set ENABLE_BUG to false to see the difference if we only change the order of disablement.

```

I only tested it in Firefox 8.0.1 on OS X 10.6. But I expect this has nothing to do with browser compatibility, rather something in the the event unbinding mechanism of oCanvas. I traced the problem to lines 3682 - 3684, however there is probably some underlying problem.

Oh, I used the most recent version of oCanvas (1.0).