Add history.state hacks for browsers not supporting it

This commit is contained in:
Piotr Sarnacki 2012-11-18 11:59:12 +01:00
parent dfd8e3323b
commit efe98e561a

View File

@ -1,6 +1,18 @@
require 'ext/jquery'
require 'ext/ember/namespace'
if window.history.state == undefined
window.history.state = {}
oldPushState = window.history.pushState
window.history.pushState = (state, title, href) ->
window.history.state = state
oldPushState.apply this, arguments
oldReplaceState = window.history.replaceState
window.history.replaceState = (state, title, href) ->
window.history.state = state
oldReplaceState.apply this, arguments
@Travis = Em.Namespace.create Ember.Evented,
config:
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')