Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: third_party/polymer/v1_0/components-chromium/app-route/app-location-extracted.js

Issue 1984963002: Roll Polymer elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/app-route/app-location-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-location-extracted.js b/third_party/polymer/v1_0/components-chromium/app-route/app-location-extracted.js
similarity index 76%
rename from third_party/polymer/v1_0/components-chromium/carbon-route/carbon-location-extracted.js
rename to third_party/polymer/v1_0/components-chromium/app-route/app-location-extracted.js
index 881fad1e23096c75b1ebbfbb482a1b5401f9eb62..4d0c4bdff4725c1c884d1c1e292df25c3046edc5 100644
--- a/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-location-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/app-route/app-location-extracted.js
@@ -1,7 +1,7 @@
'use strict';
Polymer({
- is: 'carbon-location',
+ is: 'app-location',
properties: {
/**
@@ -74,20 +74,37 @@
*/
__hash: {
type: String
+ },
+
+ /**
+ * The route path, which will be either the hash or the path, depending
+ * on useHashAsPath.
+ */
+ path: {
+ type: String,
+ observer: '__onPathChanged'
}
},
- __computeRoutePath: function(path, hash, useHashAsPath) {
- return useHashAsPath ? hash : path;
+ behaviors: [Polymer.AppRouteConverterBehavior],
+
+ observers: [
+ '__computeRoutePath(useHashAsPath, __hash, __path)'
+ ],
+
+ __computeRoutePath: function() {
+ this.path = this.useHashAsPath ? this.__hash : this.__path;
},
- __onPathChanged: function(event) {
- var path = event.detail.value;
+ __onPathChanged: function() {
+ if (!this._readied) {
+ return;
+ }
if (this.useHashAsPath) {
- this.__hash = path;
+ this.__hash = this.path;
} else {
- this.__path = path;
+ this.__path = this.path;
}
}
});

Powered by Google App Engine
This is Rietveld 408576698