           # do something
           @EZModal.modal 'hide' # hide parent
           EZModal 'Confirmation Received' # open new modal
-      ]+      ]


# default starting script: load hard-coded defaults
# this function can be overriden by other packages for integrations
BootstrapMagic.on 'start', ->
  defaultDefaults = {}
  for category in bootstrap_magic_variables
    for variable in category.data
      defaultDefaults[variable._id] = variable.value
  @setDefaults defaultDefaults

mapVariableOverrides = (obj) ->
  obj.isOverride = false


Template.bootstrap_magic_input.helpers
  'myChildren' : -> 
    items = _.map flattenedMagic, mapVariableOverrides
    return _.filter items, (obj) => obj.value?.indexOf(@._id) >- 1

Template.bootstrap_magic_input.onRendered ->
