stop loading the app config from the api cuz it adds quite a noticeable delay
This commit is contained in:
parent
3052db733b
commit
00b38062cc
|
@ -4,6 +4,7 @@ require 'ext/ember/namespace'
|
||||||
@Travis = Em.Namespace.create
|
@Travis = Em.Namespace.create
|
||||||
config:
|
config:
|
||||||
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
||||||
|
pusher_key: $('meta[name="travis.pusher_key"]').attr('value')
|
||||||
|
|
||||||
CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'jdk', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala']
|
CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'jdk', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala']
|
||||||
|
|
||||||
|
@ -36,7 +37,6 @@ require 'ext/ember/namespace'
|
||||||
run: (attrs) ->
|
run: (attrs) ->
|
||||||
location.href = location.href.replace('#!/', '') if location.hash.slice(0, 2) == '#!'
|
location.href = location.href.replace('#!/', '') if location.hash.slice(0, 2) == '#!'
|
||||||
|
|
||||||
@loadConfig (config) =>
|
|
||||||
app = Travis.App.create(attrs || {})
|
app = Travis.App.create(attrs || {})
|
||||||
# TODO: router expects the classes for controllers on main namespace, so
|
# 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
|
# if we want to keep app at Travis.app, we need to copy that, it would
|
||||||
|
@ -46,14 +46,7 @@ require 'ext/ember/namespace'
|
||||||
|
|
||||||
@app = app
|
@app = app
|
||||||
@store = app.store
|
@store = app.store
|
||||||
|
$ => app.initialize()
|
||||||
$ =>
|
|
||||||
app.initialize()
|
|
||||||
|
|
||||||
loadConfig: (callback) ->
|
|
||||||
@ajax.get '/config', (data) =>
|
|
||||||
$.extend @config, data.config
|
|
||||||
callback(data.config)
|
|
||||||
|
|
||||||
require 'travis/ajax'
|
require 'travis/ajax'
|
||||||
require 'app'
|
require 'app'
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
9cec2fc6
|
6cb6548a
|
Loading…
Reference in New Issue
Block a user