diff --git a/assets/scripts/app/routes.coffee b/assets/scripts/app/routes.coffee index 50a11562..cee26400 100644 --- a/assets/scripts/app/routes.coffee +++ b/assets/scripts/app/routes.coffee @@ -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: '/', -> diff --git a/assets/scripts/lib/travis/location.coffee b/assets/scripts/lib/travis/location.coffee index b49de069..034fd83f 100644 --- a/assets/scripts/lib/travis/location.coffee +++ b/assets/scripts/lib/travis/location.coffee @@ -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