     'click .js-button': 'save'
 
   initialize: ->
-    @state = new Backbone.Model saving: false
+    @saving = false
 
   onInput: (e) ->
     @checkInput()

    false

  save: ->
    return false if @state.get('saving')

    val = @dom.input.val().trim()

    return if val is ''

    @state.set saving: true
    @dom.button.text 'Adding'

    attrs = if isURL val
      source: val

        @dom.button.text 'Added'
        @dom.input.val ''
        @dom.input.focus()
        @dom.button.attr 'disabled', false
        @saving = false
        @checkInput()
        setTimeout (=> @dom.button.text 'Add block'), 2000

      error: (_m, e) =>
        console.error e
        @saving = false
        @dom.button.text 'Error'
        @dom.button.attr 'disabled', false
        setTimeout (=> @dom.button.text 'Add block'), 2000

  postRender: ->
