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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/more-routing/more-route-context-aware-extracted.js

Issue 1162963002: Revert "Rename polymer and cr_elements v0_8 to v1_0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1
2
3 MoreRouting.ContextAware = {
4
5 /** @override */
6 ready: function() {
7 this._makeRoutingReady();
8 },
9
10 /**
11 * Calls `routingReady`, and ensures that it is called in a top-down manner.
12 *
13 * We need to be sure that parent nodes have `routingReady` triggered before
14 * their children so that they can properly configure nested routes.
15 *
16 * Unfortunately, `ready` is sometimes bottom-up, sometimes top-down.
17 * Ideally, this wouldn't be necessary.
18 *
19 * @see https://github.com/Polymer/polymer/pull/1448
20 */
21 _makeRoutingReady: function() {
22 if (this.routingIsReady) return;
23
24 var node = this;
25 while (node = Polymer.dom(node).parentNode) {
26 if (typeof node._makeRoutingReady === 'function') break;
27 }
28 if (node) node._makeRoutingReady();
29
30 this.parentRoute = this._findParentRoute();
31 this.routingIsReady = true;
32 if (typeof this.routingReady === 'function') this.routingReady();
33 },
34
35 _findParentRoute: function() {
36 var node = this;
37 while (node) {
38 node = Polymer.dom(node).parentNode;
39 if (node && node.nodeType !== Node.ELEMENT_NODE) {
40 node = node.host;
41 }
42
43 var route = node && node.moreRouteContext;
44 if (route instanceof MoreRouting.Route) {
45 return route;
46 }
47 }
48 return null;
49 },
50
51 };
52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698