 
   dragstart: (event, element) =>
     event.dataTransfer.effectAllowed = "none"
+    event.dataTransfer.setData("text/plain", "resize")
+
     @dragging =
       editor: editor = element.parentElement
       image: editor.firstChild

      maxWidth: parseInt(getDimensions(@element).width, 10)
      startX: event.clientX

  drag: (event, element) =>
    width = @dragging.width + event.clientX - @dragging.startX
    unless width > @dragging.maxWidth
      width = "#{width}px"
      height = getDimensions(@dragging.image).height

{DOM} = Trix

class Trix.AttachmentController
  imageEditorSelector = "div.image-editor"
  imageResizeHandleSelector = "#{imageEditorSelector} div.resize-handle"

  constructor: (@element, @responder) ->
    DOM.on(@element, "click", "img", @didClickImage)
    DOM.on(@element, "dragover", @dragover)
    for event in ["dragstart", "dragend"]
      DOM.on(@element, event, imageResizeHandleSelector, @[event])

  didClickImage: (event, image) =>
