File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import Resolver from 'ember/resolver';
2
2
import initFixtures from 'ghost/fixtures/init' ;
3
3
import { currentUser , injectCurrentUser } from 'ghost/initializers/current-user' ;
4
4
import { registerNotifications , injectNotifications } from 'ghost/initializers/notifications' ;
5
+ import registerTrailingLocationHistory from 'ghost/initializers/trailing-history' ;
5
6
import 'ghost/utils/link-view' ;
6
7
import 'ghost/utils/text-field' ;
7
8
@@ -24,5 +25,6 @@ App.initializer(currentUser);
24
25
App . initializer ( injectCurrentUser ) ;
25
26
App . initializer ( registerNotifications ) ;
26
27
App . initializer ( injectNotifications ) ;
28
+ App . initializer ( registerTrailingLocationHistory ) ;
27
29
28
30
export default App ;
Original file line number Diff line number Diff line change
1
+ /*global Ember */
2
+
3
+ var trailingHistory = Ember . HistoryLocation . extend ( {
4
+ setURL : function ( path ) {
5
+ var state = this . getState ( ) ;
6
+ path = this . formatURL ( path ) ;
7
+ path = path . replace ( / \/ ? $ / , '/' ) ;
8
+
9
+ if ( state && state . path !== path ) {
10
+ this . pushState ( path ) ;
11
+ }
12
+ }
13
+ } ) ;
14
+
15
+ var registerTrailingLocationHistory = {
16
+ name : 'registerTrailingLocationHistory' ,
17
+
18
+ initialize : function ( container , application ) {
19
+ application . register ( 'location:trailing-history' , trailingHistory ) ;
20
+ }
21
+ } ;
22
+
23
+ export default registerTrailingLocationHistory ;
Original file line number Diff line number Diff line change 4
4
var Router = Ember . Router . extend ( ) ;
5
5
6
6
Router . reopen ( {
7
- location : 'history' , // use HTML5 History API instead of hash-tag based URLs
7
+ location : 'trailing- history' , // use HTML5 History API instead of hash-tag based URLs
8
8
rootURL : '/ghost/ember/' // admin interface lives under sub-directory /ghost
9
9
} ) ;
10
10
You can’t perform that action at this time.
0 commit comments