1+ /**
2+ @module ember
3+ @submodule ember-routing
4+ */
5+
16var get = Ember . get , set = Ember . set ;
27
38/**
4- @class
5-
69 Ember.HistoryLocation implements the location API using the browser's
710 history.pushState API.
811
12+ @class HistoryLocation
13+ @namespace Ember
914 @extends Ember.Object
1015*/
11- Ember . HistoryLocation = Ember . Object . extend (
12- /** @scope Ember.HistoryLocation.prototype */ {
16+ Ember . HistoryLocation = Ember . Object . extend ( {
1317
14- /** @private */
1518 init : function ( ) {
1619 set ( this , 'location' , get ( this , 'location' ) || window . location ) ;
1720 set ( this , '_initialURL' , get ( this , 'location' ) . pathname ) ;
1821 } ,
1922
2023 /**
2124 Will be pre-pended to path upon state change
22- */
25+
26+ @property rootURL
27+ @default '/'
28+ */
2329 rootURL : '/' ,
2430
2531 /**
2632 @private
2733
2834 Used to give history a starting reference
29- */
35+
36+ @property _initialURL
37+ @default null
38+ */
3039 _initialURL : null ,
3140
3241 /**
3342 @private
3443
3544 Returns the current `location.pathname`.
45+
46+ @method getURL
3647 */
3748 getURL : function ( ) {
3849 return get ( this , 'location' ) . pathname ;
@@ -42,6 +53,9 @@ Ember.HistoryLocation = Ember.Object.extend(
4253 @private
4354
4455 Uses `history.pushState` to update the url without a page reload.
56+
57+ @method setURL
58+ @param path {String}
4559 */
4660 setURL : function ( path ) {
4761 var state = window . history . state ,
@@ -59,6 +73,9 @@ Ember.HistoryLocation = Ember.Object.extend(
5973
6074 Register a callback to be invoked whenever the browser
6175 history changes, including using forward and back buttons.
76+
77+ @method onUpdateURL
78+ @param callback {Function}
6279 */
6380 onUpdateURL : function ( callback ) {
6481 var guid = Ember . guidFor ( this ) ;
@@ -72,6 +89,9 @@ Ember.HistoryLocation = Ember.Object.extend(
7289 @private
7390
7491 Used when using {{action}} helper. The url is always appended to the rootURL.
92+
93+ @method formatURL
94+ @param url {String}
7595 */
7696 formatURL : function ( url ) {
7797 var rootURL = get ( this , 'rootURL' ) ;
@@ -83,7 +103,6 @@ Ember.HistoryLocation = Ember.Object.extend(
83103 return rootURL + url ;
84104 } ,
85105
86- /** @private */
87106 willDestroy : function ( ) {
88107 var guid = Ember . guidFor ( this ) ;
89108
0 commit comments