Keep the hash in the location so we can scroll to line in logs
This commit is contained in:
parent
729d22c9a4
commit
f0ea65b114
|
@ -1,5 +1,12 @@
|
||||||
|
require 'travis/location'
|
||||||
|
|
||||||
Ember.Router.reopen
|
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 ->
|
Travis.Router.map ->
|
||||||
@resource 'index', path: '/', ->
|
@resource 'index', path: '/', ->
|
||||||
|
|
|
@ -1,16 +1,4 @@
|
||||||
Travis.Location = Ember.HistoryLocation.extend
|
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: ->
|
getURL: ->
|
||||||
location = @get('location')
|
location = @get('location')
|
||||||
location.pathname + location.hash
|
location.pathname + location.hash
|
||||||
|
|
||||||
initState: ->
|
|
||||||
@replaceState(@getURL());
|
|
||||||
Ember.set(this, 'history', window.history)
|
|
||||||
|
|
||||||
Ember.Location.implementations['travis'] = Travis.Location
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user