 Neck.Controller.runners['repeat'] = class RepeatRunner extends Neck.Controller
+
+  innerTemplate: true
 
   scope:
     filter: '='

    # Listen to update event on spine models
    if @item instanceof Spine.Model
      @listenTo @item, 'update', @render
      @listenTo @item, 'destroy', => @release()

    @checkFilter()

  checkFilter: ->
    if !@scope.filter and !@visible
      @el.show()
      @visible = true
    else
      if @item.toString()?.match new RegExp(@scope.filter, 'gi')
        unless @visible
          @el.show()
          @visible = true
      else
        if @visible
          @el.hide()
          @visible = false


          itemController
        undefined

    if @scope.hasOwnProperty 'filter'
      timeout = null
      @scope.watch 'filter', =>
        clearTimeout timeout
        timeout = setTimeout =>
          if @controllers
            @checkFilter(controller) for controller in @controllers
          undefined
        , 10

  checkFilter: (c)->
    if @scope.filter isnt undefined
      if typeof @scope.filter is 'function'
        match = @scope.filter(c.item)
      else
        match = c.item.toString()?.match new RegExp(@scope.filter, 'gi')
      if match then c.el.show() else c.el.hide()
    else
      c.el.show()

class RepeatItem extends Neck.Controller

