Add history.state hacks for browsers not supporting it
This commit is contained in:
parent
dfd8e3323b
commit
efe98e561a
|
@ -1,6 +1,18 @@
|
||||||
require 'ext/jquery'
|
require 'ext/jquery'
|
||||||
require 'ext/ember/namespace'
|
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,
|
@Travis = Em.Namespace.create Ember.Evented,
|
||||||
config:
|
config:
|
||||||
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user