 module.exports = class ClonableView extends Backbone.View
 
-  template: JST["clonable"]
+  template: JST["./clonable"]
   className: 'clonable'
   subviewContainer: '.subview-container'
   extraButtons: '.extra-buttons'

    if evt.target
      $el = $(evt.target)
    else
      $el = @$('.extra-buttons:last .btn-danger') # 假设最后一个删除按钮
    @undelegateEvents()
    if @options.allowBlank and @$el.children().length == 1
      el = $el.parents('.control-group').find(@subviewContainer).children()

      options['subviewOptions'] = {}
    if not options['allowBlank']?
      options['allowBlank'] = false
    if options['maxNumber']?
      options['maxNumber'] = parseInt options['maxNumber']
    if not options['minNumber']?
      options['minNumber'] = 1
    else
      options['minNumber'] = parseInt options['minNumber']
    if not options['initialNumber']?
      options['initialNumber'] = 1
    @options = options

  render: =>
    @$el.html(@template())
    index = 0
    if @options['minNumber'] > @options['initialNumber']
      number = @options['minNumber']
    else
      number = @options['initialNumber']
    # Initial the first subview
    if not @options['allowBlank']
      while index < number
        @add()
        index += 1
    @redrawExtraButtons()
    @
  
