     _.each $('.tpl-container'), (n)->
       $(n).find(".legend").remove()
 
-
   drag: (ev)->
     #console.log(ev.currentTarget)
     @dragged = $(ev.currentTarget)

    #ev.target.appendChild(data);
    container = $(ev.currentTarget)

    #debugger
    if @dragged.attr('data-block')
      tmpl = @handleBlock @dragged.data('block')
      @dropBlock(container, tmpl)

    ev.preventDefault()

  setDraggedEl: (e)->
    crt = $(e.currentTarget).parents(".tpl-block")[0].cloneNode(true) #.clone()
    crt.style.backgroundColor = "white";
    crt.style.position = "absolute";
    crt.style.border = "1px solid #666";
    crt.style.boxShadow = "1px 2px 2px #adadad"
    crt.style.top = "0px";
    crt.style.right = "0px";
    crt.style.opacity = 0.9;
    document.body.appendChild(crt);
    e.dataTransfer = e.originalEvent.dataTransfer;
    e.dataTransfer.setDragImage(crt, 0, 0);
