Sha256: 78244e1fbc878d7cba737e1e72cbc803e098d9b6b996c6ebe933d7b6d84de259

Contents?: true

Size: 594 Bytes

Versions: 10

Compression:

Stored size: 594 Bytes

Contents

pageLoad = ->
  actionClassName = $('body').data('action-view')
  window.currentView = try
    eval("new #{actionClassName}()")
  catch error
    controllerClassName = $('body').data('controller-view')
    window.currentView = try
      eval("new #{controllerClassName}()")
    catch error
      new MagicView()
  window.currentView.render()

$ ->
  pageLoad()

  # turbolinks
  $(document).on 'page:load', pageLoad
  $(document).on 'page:before-change', ->
    window.currentView.cleanup()
    true
  $(document).on 'page:restore', ->
    window.currentView.cleanup()
    pageLoad()
    true

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
silmarails-0.3.0 app/assets/javascripts/magic_view/init.coffee
silmarails-0.2.2 app/assets/javascripts/magic_view/init.coffee
silmarails-0.2.1 app/assets/javascripts/magic_view/init.coffee
silmarails-0.2.0 app/assets/javascripts/magic_view/init.coffee
silmarails-0.1.1 app/assets/javascripts/magic_view/init.coffee
genesis_rails-0.1.1 app/assets/javascripts/magic_view/init.coffee
genesis_rails-0.1.0 app/assets/javascripts/magic_view/init.coffee
genesis_rails-0.0.8 app/assets/javascripts/magic_view/init.coffee
genesis_rails-0.0.7 app/assets/javascripts/magic_view/init.coffee
genesis_rails-0.0.6 app/assets/javascripts/magic_view/init.coffee