     @setRangeAt($(element).prev()[0])
     $(element).remove()
 
+  #TODO: not used anymore, remove this
   #when found that the current node is text node
   #create a new <p> and focus
   handleUnwrappedNode: (element)->


    #enter key
    if (e.which == 13)
      #removes previous selected nodes
      $(@el).find(".is-selected").removeClass("is-selected")



      # Check if the container is a text node and return its parent if so
      (if container.nodeType is 3 then container.parentNode else container)

#http://stackoverflow.com/questions/12603397/calculate-width-height-of-the-selected-text-javascript
utils.getSelectionDimensions = ->
  sel = document.selection
  range = undefined
  width = 0
  height = 0
  left = 0
  top = 0
  if sel
    unless sel.type is "Control"
      range = sel.createRange()
      width = range.boundingWidth
      height = range.boundingHeight
  else if window.getSelection
    sel = window.getSelection()
    if sel.rangeCount
      range = sel.getRangeAt(0).cloneRange()
      if range.getBoundingClientRect
        rect = range.getBoundingClientRect()
        width = rect.right - rect.left
        height = rect.bottom - rect.top

  width: width
  height: height
  top: rect.top
  left: rect.left


class Dante.Editor extends Dante.View
  #el: "#editor"
