mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: Use the container to register Discourse's custom location handler
This commit is contained in:
parent
2f9bb6b88f
commit
fc65bc28be
3 changed files with 7 additions and 3 deletions
|
@ -165,4 +165,9 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
|
||||
});
|
||||
|
||||
Discourse.Router = Discourse.Router.reopen({ location: 'discourse_location' });
|
||||
Discourse.initializer({
|
||||
name: "register-discourse-location",
|
||||
initialize: function(container, application) {
|
||||
application.register('location:discourse-location', Ember.DiscourseLocation);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -255,8 +255,6 @@ Ember.DiscourseLocation = Ember.Object.extend({
|
|||
|
||||
});
|
||||
|
||||
Ember.Location.registerImplementation('discourse_location', Ember.DiscourseLocation);
|
||||
|
||||
/**
|
||||
Since we're using pushState/replaceState let's add extra hooks to cloakedView to
|
||||
eject itself when the popState occurs. This results in better back button
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
Discourse.BaseUri = '<%= Discourse::base_uri "/" %>';
|
||||
Discourse.Environment = '<%= Rails.env %>';
|
||||
Discourse.SiteSettings = PreloadStore.get('siteSettings');
|
||||
Discourse.Router = Ember.Router.extend({ location: 'discourse-location' });
|
||||
Discourse.Router.map(function() { Discourse.routeBuilder.call(this); });
|
||||
Discourse.start();
|
||||
Discourse.set('assetVersion','<%= Discourse.assets_digest %>');
|
||||
|
|
Loading…
Reference in a new issue