   enable: ->
     unless @enabled
       @$el.on "dragstart", @options.itemSelector, $.proxy(this, "_handleDragstart")
-      @$el.on "dragover", @options.itemSelector, $.proxy(this, "_handleDragover")
+      @$el.on "dragover", $.proxy(this, "_handleDragover")
       @enabled = true
 
   disable: ->
     if @enabled
       @$el.off "dragstart", @options.itemSelector, @_handleDragstart
-      @$el.off "dragover", @options.itemSelector, @_handleDragover
+      @$el.off "dragover", @_handleDragover
       @enabled = false
       $(@placeholder).detach() if @placeholder
 

  _handleDragover: normalizeEventCallback (e, dataTransfer) ->
    if @_shouldAccept(e, dataTransfer)
      e.preventDefault()
      currentTarget = e.currentTarget
      if currentTarget != @placeholder
        directionals = if @options.direction == "vertical"
          {
            before: "top"

            clientPosition: e.originalEvent.clientX
          }

        rect = draggedOver.getBoundingClientRect()

        position = draggedOver.compareDocumentPosition(@placeholder) if @placeholder
        if !@placeholder || position & Node.DOCUMENT_POSITION_DISCONNECTED
          if (rect[directionals.before] - directionals.clientPosition + @options.tolerance) >= 0
            @_flip(event, draggedOver, dataTransfer, "before")
          else if (rect[directionals.after] - directionals.clientPosition - @options.tolerance) <= 0
            @_flip(event, draggedOver, dataTransfer, "after")
        else if position & Node.DOCUMENT_POSITION_FOLLOWING
          if (rect[directionals.before] - directionals.clientPosition + @options.tolerance) >= 0
            @_flip(event, draggedOver, dataTransfer, "before")
        else if position & Node.DOCUMENT_POSITION_PRECEDING
          if (rect[directionals.after] - directionals.clientPosition - @options.tolerance) <= 0
            @_flip(event, draggedOver, dataTransfer, "after")

  _flip: (event, element, dataTransfer, keyword, options = {}) ->
    @_boot()

    @options.over?(event, element, typesForDataTransfer(dataTransfer))

    if !@placeholder
      @placeholder = @options.placeholder(event, @_elements.length)
      $(@placeholder).on("drop", $.proxy(this, "_handleDrop"))
      $(@placeholder).on "dragover", (e) ->
        event.preventDefault()
    else
      $(@placeholder).detach()

    $(element)[keyword](@placeholder)

    if config("activeSession")?.valid(dataTransfer)
      session = config("activeSession")

    @options.insertPlaceholder?(@placeholder, @_elements, session)
    event.stopPropagation()

  _elementMatchesItemSelector: (element) ->
    !!$(element).filter(@options.itemSelector).length

  _parentOfElementThatMatchesItemSelector: (element) ->
    contender = $(element).closest(@options.itemSelector)[0]

    if contender != @el && @el.contains(contender)
      return contender
    else
      return null

module.exports = Sortable
