Merge branch 'ps-ember-update' of github.com:travis-ci/travis-web into ps-ember-update

This commit is contained in:
Sven Fuchs 2013-02-23 00:21:59 +01:00
commit 8df5aaa97d
2 changed files with 8 additions and 13 deletions

View File

@ -1,5 +1,12 @@
require 'travis/location'
Ember.Router.reopen
location: (if testMode? then Ember.HashLocation.create() else Ember.HistoryLocation.create())
location: (if testMode? then Ember.HashLocation.create() else Travis.Location.create())
handleURL: (url) ->
console.log 'our handle url', url
url = url.replace(/#.*?$/, '')
@_super(url)
Travis.Router.map ->
@resource 'index', path: '/', ->

View File

@ -1,16 +1,4 @@
Travis.Location = Ember.HistoryLocation.extend
onUpdateURL: (callback) ->
guid = Ember.guidFor(this)
Ember.$(window).bind 'popstate.ember-location-'+guid, (e) ->
callback(location.pathname + location.hash)
getURL: ->
location = @get('location')
location.pathname + location.hash
initState: ->
@replaceState(@getURL());
Ember.set(this, 'history', window.history)
Ember.Location.implementations['travis'] = Travis.Location