Skip to content
Browse files

Remove hover class when leaving the drop zone.

  • Loading branch information...
1 parent 9744a46 commit 4bcb614c9ab25c021078f548de3c13e65aafa86a @jsteiner jsteiner committed Aug 4, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/assets/javascripts/jack_up/drag_and_drop.coffee
View
9 lib/assets/javascripts/jack_up/drag_and_drop.coffee
@@ -5,20 +5,21 @@ ignoreEvent = (event) ->
class @JackUp.DragAndDrop
constructor: (@droppableElement, @processor) ->
@droppableElement
- .bind("dragenter", @_drag)
+ .bind("dragenter", @_dragEnter)
+ .bind("dragleave", @_dragLeave)
.bind("drop", @_drop)
- .bind("drop", @_dragOut)
- _drag: (event) =>
+ _dragEnter: (event) =>
ignoreEvent event
event.originalEvent.dataTransfer.dropEffect = "copy"
@droppableElement.addClass("hover")
- _dragOut: (event) =>
+ _dragLeave: (event) =>
ignoreEvent event
@droppableElement.removeClass("hover")
_drop: (event) =>
ignoreEvent event
+ @droppableElement.removeClass("hover")
@droppableElement.find('[data-placeholder]').hide()
@processor.processFilesForEvent(event)

0 comments on commit 4bcb614

Please sign in to comment.
Something went wrong with that request. Please try again.