desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 386 forks source link

Binding to Draggabilly events in Coffeescript #172

Closed lorenzopt closed 6 years ago

lorenzopt commented 7 years ago

I've trying to bind to the 'dragEnd' event in Coffeescript with packery, but the handler is not being called:

Here is my code: ` els = packery.getItemElements()

    for elem in els
      draggable = new Draggabilly( elem )
      packery.bindDraggabillyEvents( draggable )
      $(draggable).on 'dragEnd', (dragIns, event,) ->
        console.log event`

Where might I be going wrong? New to Coffeescript, by the way.

desandro commented 7 years ago

Sorry, I don't have experience with CoffeeScript. Try forking this demo and getting your code to work.