travis-web/assets/scripts/lib/travis/location.coffee
Piotr Sarnacki 939212302a Fix loading page with #L<line-number>
Ember changed a way HistoryLocation works and it no longer calls
getURL(). I'm monkey patching it, but I will submit a pull request to
fix it.
2012-10-22 21:45:43 +02:00

17 lines
461 B
CoffeeScript

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