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

Side by Side Diff: third_party/polymer/v0_8/components-chromium/paper-dialog-scrollable/paper-dialog-scrollable-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 (function() {
4
5 Polymer({
6
7 is: 'paper-dialog-scrollable',
8
9 properties: {
10
11 /**
12 * The dialog element that implements `Polymer.PaperDialogBehavior` contai ning this element.
13 */
14 dialogElement: {
15 type: Object,
16 value: function() {
17 return this.parentNode;
18 }
19 }
20
21 },
22
23 listeners: {
24 'scrollable.scroll': '_onScroll',
25 'iron-resize': '_onIronResize'
26 },
27
28 /**
29 * Returns the scrolling element.
30 */
31 get scrollTarget() {
32 return this.$.scrollable;
33 },
34
35 attached: function() {
36 this.classList.add('no-padding');
37 // Set itself to the overlay sizing target
38 this.dialogElement.sizingTarget = this.scrollTarget;
39 // If the host is sized, fit the scrollable area to the container. Otherwi se let it be
40 // its natural size.
41 requestAnimationFrame(function() {
42 if (this.offsetHeight > 0) {
43 this.$.scrollable.classList.add('fit');
44 }
45 this._scroll();
46 }.bind(this));
47 },
48
49 _scroll: function() {
50 this.toggleClass('is-scrolled', this.scrollTarget.scrollTop > 0);
51 this.toggleClass('can-scroll', this.scrollTarget.offsetHeight < this.scrol lTarget.scrollHeight);
52 this.toggleClass('scrolled-to-bottom',
53 this.scrollTarget.scrollTop + this.scrollTarget.offsetHeight >= this.scr ollTarget.scrollHeight);
54 },
55
56 _onScroll: function() {
57 this._scroll();
58 }
59
60 })
61
62 })();
63
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698