     childs.first().addClass("graf--first")
     childs.last().addClass("graf--last")
 
-  getTextNodesIn: (node, includeWhitespaceNodes) ->
-    getTextNodes = (node) ->
-      if node.nodeType is 3
-        textNodes.push node  if includeWhitespaceNodes or not whitespace.test(node.nodeValue)
-      else
-        i = 0
-        len = node.childNodes.length
-        while i < len
-          getTextNodes node.childNodes[i]
-          ++i
-      return
-    textNodes = []
-    whitespace = /^\s*$/
-    getTextNodes node
-    textNodes
-
   wrapTextNodes: ()->
-    @textnodes = @getTextNodesIn($(@el).find(".section-inner")[0])
-    _.each @textnodes.length , (num, index)=>
-      if $(@textnodes[i]).parent().is(".section-inner")
-        $(@textnodes[i]).wrap("<p>")
+    $(@el).find(".section-inner").contents().filter(->
+      @nodeType is 3 and @data.trim().length > 0
+    ).wrap "<p class='graf grap--p'></p>"
 
 class Editor.Menu extends Backbone.View
   el: "#editor-menu"

    @tooltip_view.render()
    @tooltip_view.move(left: @position.left - 60 , top: @position.top - 5 )

  #mak the current row as selected
  markAsSelected: (element)->
    $(@el).find(".is-selected").removeClass("is-selected")
    $(element).addClass("is-selected")
    $(element).find(".defaultValue").remove()
    #set reached top if element is first!
    @reachedTop = true if $(element).hasClass("graf--first")

  setupElementsClasses: (cb)->
    setTimeout ()=>

+ actions over text
+ placeholders for first (empty) node
+ on paste set caret to the last (or first?) element
+ parse images or objects
+ remove inner spans and other shits
+ WRAP INTO PARAGRAPHS ORPHANS
  + convert divs into p
  + a, img,  wrap with p
###

# make it accessible
