clientIO / JointJS_plus

JointJS+ support
4 stars 9 forks source link

SelectionView problem when using jQueryUI #37

Closed JoseGoncalves closed 9 years ago

JoseGoncalves commented 10 years ago

Hi,

If an app uses the SelectionView plugin with jQuery UI the folllowing error occurs at initialization:

Uncaught Error: cannot call methods on draggable prior to initialization; attempted to call method 'false'

This problem can be reproduced in the SelectionView demo app supplied with Rappid by replacing in index.html:

<script src="../../../../dist/joint.js"></script>

with:

<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.min.js"></script>
<script src="../../../../dist/joint.nojquery.js"></script>

Best regards, José Gonçalves

DavidDurman commented 10 years ago

This has something to do with how SelectionView disables the "dragging" effect on images in Firefox (https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Drag_operations). It sets the draggable attribute to false. Somehow, jQuery UI cannot deal with this. This looks more like a bug in jQuery UI than in Rappid. Let us have a closer look on what we can do with this....

JoseGoncalves commented 10 years ago

As a temporary workaround in my app, I removed the draggable attribute in the call that triggers the error, and it all seems to work fine for me.

robertvorthman commented 9 years ago

Thanks Jose! I was having the same issue, and got stuck thinking it was an incompatibility with the version of jQuery embedded in the joint.js file. I commented out the line "draggable: 'false'," in joint.ui.selectionView.js like you said and the issue went away.

JoseGoncalves commented 9 years ago

Any update on this issue? Is this really a bug in jQuery UI?

DavidDurman commented 9 years ago

We'll be reviewing this before the next update. It's on our list.

raohammad commented 9 years ago

I was also having same issue and fixed this by commenting draggable: 'false' in selectionView.js... I am not quite sure what I lose by disabling it - if someone may comment?

kumilingus commented 9 years ago

Fixed in v1.5. draggable: false was removed. Not needed.