Initialize application in Ember.next, fixes auth

This commit is contained in:
Piotr Sarnacki 2012-10-10 16:13:21 +02:00
parent 24d98eb66a
commit 404dde1cdf
4 changed files with 13 additions and 12 deletions

View File

@ -37,16 +37,17 @@ require 'ext/ember/namespace'
run: (attrs) ->
location.href = location.href.replace('#!/', '') if location.hash.slice(0, 2) == '#!'
app = Travis.App.create(attrs || {})
# TODO: router expects the classes for controllers on main namespace, so
# if we want to keep app at Travis.app, we need to copy that, it would
# be ideal to send a patch to ember and get rid of this
$.each Travis, (key, value) ->
app[key] = value if value && value.isClass && key != 'constructor'
Ember.run.next this, ->
app = Travis.App.create(attrs || {})
# TODO: router expects the classes for controllers on main namespace, so
# if we want to keep app at Travis.app, we need to copy that, it would
# be ideal to send a patch to ember and get rid of this
$.each Travis, (key, value) ->
app[key] = value if value && value.isClass && key != 'constructor'
@app = app
@store = app.store
$ => app.initialize()
@app = app
@store = app.store
$ => app.initialize()
require 'travis/ajax'
require 'app'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
bb4e051b
19b5fc63