Sha256: 621dad98b3d59858770e195337cd47a7a84c6fd4f795b9233b1479ba0da4df56

Contents?: true

Size: 683 Bytes

Versions: 13

Compression:

Stored size: 683 Bytes

Contents

#= require "./dom-helpers"

{div, link} = Suite
context = null

controller = (name) ->
  div link name, ->
    context or= new Jax.Context "webgl"
    # jax doesn't unload redirects to the same controller.
    # Within a single app this is probably expected behavior.
    # But, in this particular context, user most likely wants
    # to reload the controller entirely. So we need to manually
    # kick off the cleanup procedure.
    context.unloadScene()
    context.redirectTo name
    false
  
$(document).ready ->
  controller_list = $("#controller-list")[0]
  
  for controller_name in Jax.routes.getControllerNames()
    $(controller_list).append controller(controller_name)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
jax-2.0.12 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.11 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.10 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.9 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.8 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.7 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.6 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.5 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.4 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.3 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.2 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.1 app/assets/javascripts/jax/controller-list.js.coffee
jax-2.0.0 app/assets/javascripts/jax/controller-list.js.coffee