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

Side by Side Diff: third_party/polymer/v0_8/components-chromium/neon-animation/neon-shared-element-animation-behavior-extracted.js

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh 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 /**
4 * Use `Polymer.NeonSharedElementAnimationBehavior` to implement shared elemen t animations.
5 * @polymerBehavior
6 */
7 Polymer.NeonSharedElementAnimationBehavior = [Polymer.NeonAnimationBehavior, {
8
9 properties: {
10
11 /**
12 * Cached copy of shared elements.
13 */
14 sharedElements: {
15 type: Object
16 }
17
18 },
19
20 /**
21 * Finds shared elements based on `config`.
22 */
23 findSharedElements: function(config) {
24 var fromPage = config.fromPage;
25 var toPage = config.toPage;
26 if (!fromPage || !toPage) {
27 console.warn(this.is + ':', !fromPage ? 'fromPage' : 'toPage', 'is undef ined!');
28 return null;
29 };
30
31 if (!fromPage.sharedElements || !toPage.sharedElements) {
32 console.warn(this.is + ':', 'sharedElements are undefined for', !fromPag e.sharedElements ? fromPage : toPage);
33 return null;
34 };
35
36 var from = fromPage.sharedElements[config.id]
37 var to = toPage.sharedElements[config.id];
38
39 if (!from || !to) {
40 console.warn(this.is + ':', 'sharedElement with id', config.id, 'not fou nd in', !from ? fromPage : toPage);
41 return null;
42 }
43
44 this.sharedElements = {
45 from: from,
46 to: to
47 };
48 return this.sharedElements;
49 }
50
51 }];
52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698