         lines.addClass(klass)
         lines.length > 0
 
+    @on 'focus', =>
+      if @component?
+        @component.onFocus()
+      else
+        @focusOnAttach = true
 
   getEditor: -> @editor
 

  getPane: ->
    @parent('.item-views').parents('.pane').view()

  focus: ->
    if @component?
      @component.onFocus()
    else
      @focusOnAttach = true

  hide: ->
    super
    @pollComponentDOM()

  @content: (params) ->
    attributes = params.attributes ? {}
    attributes.class = 'editor react editor-colors'
    attributes.tabIndex = -1
    @div attributes

  focusOnAttach: false
