koggdal/ocanvas — Issue #27: dragAndDrop fails after disabling and re-enabling
Author: kjantzer
Created: 2012-01-27 22:49:13+00:00
State: open

I have created a bunch of text objects and made them dragAndDrop().

Then later in my app, I iterate through my objects and turn drag and drop off
theTextObj.dragAndDrop(false)

Then, if I click anywhere in the canvas, I see this error in the console:

Uncaught TypeError: Cannot call method 'call' of undefined ocanvas-1.1-dev.js:1637

This is at line 1637:

```javascript
triggerHandlers: function (obj, types) {
var i, handlers, numHandlers, n, e;

for (i = 0; i < types.length; i++) {
handlers = obj.events[types[i]];
e = ~types[i].indexOf("key") ? this.lastKeyboardEventObject : this.lastPointerEventObject;
e.type = types[i];

if (handlers) {
numHandlers = handlers.length;
for (n = 0; n < numHandlers; n++) {
handlers[n].call(obj, e);
}
}
}
},
```

Then, if I try to make my objects dragAndDrop again, nothing happens. I can still do other things with my objects like rotate, adjust size, etc.