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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/paper-dialog-scrollable-extracted.js

Issue 1221923003: Update bower.json for Polymer elements and add PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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 * @type {?Node}
14 */
15 dialogElement: {
16 type: Object,
17 value: function() {
18 return this.parentNode;
19 }
20 }
21
22 },
23
24 listeners: {
25 'scrollable.scroll': '_onScroll',
26 'iron-resize': '_onIronResize'
27 },
28
29 /**
30 * Returns the scrolling element.
31 */
32 get scrollTarget() {
33 return this.$.scrollable;
34 },
35
36 attached: function() {
37 this.classList.add('no-padding');
38 // Set itself to the overlay sizing target
39 this.dialogElement.sizingTarget = this.scrollTarget;
40 // If the host is sized, fit the scrollable area to the container. Otherwi se let it be
41 // its natural size.
42 requestAnimationFrame(function() {
43 if (this.offsetHeight > 0) {
44 this.$.scrollable.classList.add('fit');
45 }
46 this._scroll();
47 }.bind(this));
48 },
49
50 _scroll: function() {
51 this.toggleClass('is-scrolled', this.scrollTarget.scrollTop > 0);
52 this.toggleClass('can-scroll', this.scrollTarget.offsetHeight < this.scrol lTarget.scrollHeight);
53 this.toggleClass('scrolled-to-bottom',
54 this.scrollTarget.scrollTop + this.scrollTarget.offsetHeight >= this.scr ollTarget.scrollHeight);
55 },
56
57 _onScroll: function() {
58 this._scroll();
59 }
60
61 })
62
63 })();
64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698