       self.closeImageControls()
       mediumEditor.activate()
 
-
   openImageControls: (image) ->
+    console.log image
     image.addClass("medium-active-image")
     $("#medium-image-width").val(image[0].style.width)
     $("#medium-image-height").val(image[0].style.height)

    $('body').on "click", ".medium-image-float", () ->
      direction = $(this).data("float")
      image = $(".medium-active-image")
      console.log direction
      switch direction
        when "left" then image.removeClass("pull-right pull-left").addClass("pull-left")
        when "right" then image.removeClass("pull-right pull-left").addClass("pull-right")


    $("body").click (e) ->
      target = $(e.target)
      if !target.is(".medium-editor img") && !target.hasClass("medium-image-controls") && !(target.closest(".medium-image-controls").length > 0) && $('.medium-image-controls').is(":visible")
        self.closeImageControls()
        mediumEditor.activate()

    $("body").on 'click', '.medium-editor img', (e) ->
      active = $(this).hasClass("medium-active-image")
      unless active
        $(this).addClass "medium-active-image"
        $("#medium-image-width").val($(this)[0].style.width)
        $("#medium-image-height").val($(this)[0].style.height)
        $("#medium-image-button").hide()
        $(".medium-image-controls").show()
        mediumEditor.deactivate()

    $('body').on "keyup", "#medium-image-width", () ->
