Sha256: c5afe71614e67b81be53179f1da42331587c2f2cd139a3d7cb2ff8522f267136

Contents?: true

Size: 584 Bytes

Versions: 5

Compression:

Stored size: 584 Bytes

Contents

App.init = ->
  
  # Not components
  FastClick.attach(document.body)
  
  # Components
  _.forIn App.Components, (component, name) ->
    # only init a component if its 'el' exist in the DOM
    # global component's 'el' is set to 'body' so they get
    # initialized on all pages
    if typeof(component.prototype.el) != 'undefined' && $(component.prototype.el).length != 0
      console.info "Initializing component: #{name}"
      new component
  # Notify all components have initialized
  console.info 'App ready'
  App.Dispatch.trigger 'app:ready'
  
$(document).ready App.init

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
frenerator-0.3.0 lib/generators/frenerator/frontend/templates/javascripts/main.coffee
frenerator-0.2.3 lib/generators/frenerator/frontend/templates/javascripts/main.coffee
frenerator-0.2.2 lib/generators/frenerator/frontend/templates/javascripts/main.coffee
frenerator-0.2.1 lib/generators/frenerator/frontend/templates/javascripts/main.coffee
frenerator-0.2.0 lib/generators/frenerator/frontend/templates/javascripts/main.coffee