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

Unified Diff: third_party/polymer/v0_8/components-chromium/more-routing/more-route-selection-extracted.js

Issue 1140393002: Update more-routing for md-settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/v0_8/components-chromium/more-routing/more-route-selection-extracted.js
diff --git a/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selection-extracted.js b/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selection-extracted.js
index 4562e4d16b1800fbea5c60538edb0b60288d694e..9e76752a27a17c871c3ba548f1c6e798dc5e2a60 100644
--- a/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selection-extracted.js
+++ b/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selection-extracted.js
@@ -101,15 +101,15 @@
* Tracks changes to the routes.
*/
_observeRoutes: function() {
- if (this._observer) {
- this._observer.close();
- }
- // TODO(nevir): https://github.com/Polymore/more-routing/issues/24
- this._observer = new CompoundObserver();
- for (var i = 0, routeInfo; routeInfo = this._routeInfo[i]; i++) {
- this._observer.addPath(routeInfo.model, 'active');
+ if (this._routeListeners) {
+ for (var i = 0, listener; listener = this._routeListeners[i]; i++) {
+ listener.close();
+ }
}
- this._observer.open(this._evaluate.bind(this));
+
+ this._routeListeners = this._routeInfo.map(function(routeInfo) {
+ return routeInfo.model.__subscribe(this._evaluate.bind(this));
+ }.bind(this));
},
_evaluate: function() {

Powered by Google App Engine
This is Rietveld 408576698