Sha256: 1e54e4bc245c76d26d46fa515b9f05f223546ba1ff63f5ed1972eb5e82d116fc

Contents?: true

Size: 590 Bytes

Versions: 4

Compression:

Stored size: 590 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

4 entries across 4 versions & 1 rubygems

Version Path
frenerator-0.1.4 lib/generators/frenerator/frontend/templates/javascripts/main.coffee
frenerator-0.1.3 lib/generators/frenerator/frontend/templates/javascripts/main.coffee
frenerator-0.1.2 lib/generators/frenerator/frontend/templates/javascripts/main.coffee
frenerator-0.1.1 lib/generators/frenerator/frontend/templates/javascripts/main.coffee