| OLD | NEW |
| 1 'use strict'; | 1 'use strict'; |
| 2 | 2 |
| 3 Polymer({ | 3 Polymer({ |
| 4 is: 'carbon-location', | 4 is: 'app-location', |
| 5 | 5 |
| 6 properties: { | 6 properties: { |
| 7 /** | 7 /** |
| 8 * A model representing the deserialized path through the route tree, as | 8 * A model representing the deserialized path through the route tree, as |
| 9 * well as the current queryParams. | 9 * well as the current queryParams. |
| 10 */ | 10 */ |
| 11 route: { | 11 route: { |
| 12 type: Object, | 12 type: Object, |
| 13 notify: true | 13 notify: true |
| 14 }, | 14 }, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 */ | 67 */ |
| 68 __query: { | 68 __query: { |
| 69 type: String | 69 type: String |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * The hash portion of the current URL. | 73 * The hash portion of the current URL. |
| 74 */ | 74 */ |
| 75 __hash: { | 75 __hash: { |
| 76 type: String | 76 type: String |
| 77 }, |
| 78 |
| 79 /** |
| 80 * The route path, which will be either the hash or the path, depending |
| 81 * on useHashAsPath. |
| 82 */ |
| 83 path: { |
| 84 type: String, |
| 85 observer: '__onPathChanged' |
| 77 } | 86 } |
| 78 }, | 87 }, |
| 79 | 88 |
| 80 __computeRoutePath: function(path, hash, useHashAsPath) { | 89 behaviors: [Polymer.AppRouteConverterBehavior], |
| 81 return useHashAsPath ? hash : path; | 90 |
| 91 observers: [ |
| 92 '__computeRoutePath(useHashAsPath, __hash, __path)' |
| 93 ], |
| 94 |
| 95 __computeRoutePath: function() { |
| 96 this.path = this.useHashAsPath ? this.__hash : this.__path; |
| 82 }, | 97 }, |
| 83 | 98 |
| 84 __onPathChanged: function(event) { | 99 __onPathChanged: function() { |
| 85 var path = event.detail.value; | 100 if (!this._readied) { |
| 101 return; |
| 102 } |
| 86 | 103 |
| 87 if (this.useHashAsPath) { | 104 if (this.useHashAsPath) { |
| 88 this.__hash = path; | 105 this.__hash = this.path; |
| 89 } else { | 106 } else { |
| 90 this.__path = path; | 107 this.__path = this.path; |
| 91 } | 108 } |
| 92 } | 109 } |
| 93 }); | 110 }); |
| OLD | NEW |