Search code examples
jquery-uiember.jsjquery-ui-draggablejquery-ui-droppable

Emberjs and jQuery UI clone helper


I'm trying to get jqueryui drag and drop to work with emberjs. I have a fiddle set up here: http://jsfiddle.net/XMgwV/13/ but I cant seem to get the drop event to fire. The mixin is from this demo: http://www.lukemelia.com/blog/archives/2012/03/10/using-ember-js-with-jquery-ui/

Edit:
If I change the jQueryUI draggable helper function to 'original' it works as expected. It seems to be a problem with jquery ui .clone() and ember, as pointed out in #7 here. The safeClone method in the codebrief blog post does not seem to solve the problem fully..

Anyone knows how to get this to work as expected?


Solution

  • It looks like your example will work if you add:

        clone.removeClass('ember-view');
    

    to the safeClone helper.

    Here's a jsfiddle that should solve the problem: http://jsfiddle.net/Wu2cu/