     'click .fb-tabs a': 'showTab'
     'click .fb-add-field-types a': 'addField'
 
+  # unless the user is editing text, let's intercept delete keypresses. otherwise too easy to go back in the history
+  captureDelete: (evt) ->
+    if (evt.which == DELETE_KEYCODE or evt.keyCode == DELETE_KEYCODE)
+      if (evt.target and evt.target.type == "text")
+        return true
+      else
+        return false
+
   initialize: (options) ->
+    $(document).keydown(@captureDelete)
+
     {selector, @formBuilder, @bootstrapData} = options
 
     if (!(@bootstrapData instanceof Array))

    'click .js-remove-option': 'removeOption'
    'click .js-default-updated': 'defaultUpdated'
    'input .option-label-input': 'forceRender'

  initialize: (options) ->
    {@parentView} = options

emptyOrWhitespaceRegex = RegExp(/^\s*$/)
DELETE_KEYCODE = 8
ENTER_KEYCODE = 13


class FormbuilderModel extends Backbone.DeepModel
  sync: -> # noop
