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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js

Issue 1400813008: Fix closure compile after Polymer update (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@roll-polymer
Patch Set: Created 5 years, 2 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
1 /** 1 /**
2 * `Polymer.PaperRippleBehavior` dynamically implements a ripple 2 * `Polymer.PaperRippleBehavior` dynamically implements a ripple
3 * when the element has focus via pointer or keyboard. 3 * when the element has focus via pointer or keyboard.
4 * 4 *
5 * NOTE: This behavior is intended to be used in conjunction with and after 5 * NOTE: This behavior is intended to be used in conjunction with and after
6 * `Polymer.IronButtonState` and `Polymer.IronControlState`. 6 * `Polymer.IronButtonState` and `Polymer.IronControlState`.
7 * 7 *
8 * @polymerBehavior Polymer.PaperRippleBehavior 8 * @polymerBehavior Polymer.PaperRippleBehavior
9 */ 9 */
10 Polymer.PaperRippleBehavior = { 10 Polymer.PaperRippleBehavior = {
(...skipping 26 matching lines...) Expand all
37 _downHandler: function(event) { 37 _downHandler: function(event) {
38 Polymer.IronButtonStateImpl._downHandler.call(this, event); 38 Polymer.IronButtonStateImpl._downHandler.call(this, event);
39 if (this.pressed) { 39 if (this.pressed) {
40 this.ensureRipple(event); 40 this.ensureRipple(event);
41 } 41 }
42 }, 42 },
43 43
44 /** 44 /**
45 * Ensures this element contains a ripple effect. For startup efficiency 45 * Ensures this element contains a ripple effect. For startup efficiency
46 * the ripple effect is dynamically on demand when needed. 46 * the ripple effect is dynamically on demand when needed.
47 * @param {event} triggeringEvent (optional) event that triggered the 47 * @param {!Event=} opt_triggeringEvent (optional) event that triggered the
48 * ripple. 48 * ripple.
49 */ 49 */
50 ensureRipple: function(triggeringEvent) { 50 ensureRipple: function(opt_triggeringEvent) {
51 if (!this.hasRipple()) { 51 if (!this.hasRipple()) {
52 this._ripple = this._createRipple(); 52 this._ripple = this._createRipple();
53 this._ripple.noink = this.noink; 53 this._ripple.noink = this.noink;
54 var rippleContainer = this._rippleContainer || this.root; 54 var rippleContainer = this._rippleContainer || this.root;
55 if (rippleContainer) { 55 if (rippleContainer) {
56 Polymer.dom(rippleContainer).appendChild(this._ripple); 56 Polymer.dom(rippleContainer).appendChild(this._ripple);
57 } 57 }
58 var domContainer = rippleContainer === this.shadyRoot ? this : 58 var domContainer = rippleContainer === this.shadyRoot ? this :
59 rippleContainer; 59 rippleContainer;
60 if (triggeringEvent && domContainer.contains(triggeringEvent.target)) { 60 if (opt_triggeringEvent &&
61 this._ripple.uiDownAction(triggeringEvent); 61 domContainer.contains(opt_triggeringEvent.target)) {
62 this._ripple.uiDownAction(opt_triggeringEvent);
62 } 63 }
63 } 64 }
64 }, 65 },
65 66
66 /** 67 /**
67 * Returns the `<paper-ripple>` element used by this element to create 68 * Returns the `<paper-ripple>` element used by this element to create
68 * ripple effects. The element's ripple is created on demand, when 69 * ripple effects. The element's ripple is created on demand, when
69 * necessary, and calling this method will force the 70 * necessary, and calling this method will force the
70 * ripple to be created. 71 * ripple to be created.
71 */ 72 */
(...skipping 18 matching lines...) Expand all
90 _createRipple: function() { 91 _createRipple: function() {
91 return document.createElement('paper-ripple'); 92 return document.createElement('paper-ripple');
92 }, 93 },
93 94
94 _noinkChanged: function(noink) { 95 _noinkChanged: function(noink) {
95 if (this.hasRipple()) { 96 if (this.hasRipple()) {
96 this._ripple.noink = noink; 97 this._ripple.noink = noink;
97 } 98 }
98 } 99 }
99 100
100 }; 101 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698