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

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

Issue 2158913007: Roll Polymer from 1.5.0 -> 1.6.0 to pick up native CSS custom props (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 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
1 /** 1 /**
2 * Use `Polymer.PaperCheckedElementBehavior` to implement a custom element 2 * Use `Polymer.PaperCheckedElementBehavior` to implement a custom element
3 * that has a `checked` property similar to `Polymer.IronCheckedElementBehavio r` 3 * that has a `checked` property similar to `Polymer.IronCheckedElementBehavio r`
4 * and is compatible with having a ripple effect. 4 * and is compatible with having a ripple effect.
5 * @polymerBehavior Polymer.PaperCheckedElementBehavior 5 * @polymerBehavior Polymer.PaperCheckedElementBehavior
6 */ 6 */
7 Polymer.PaperCheckedElementBehaviorImpl = { 7 Polymer.PaperCheckedElementBehaviorImpl = {
8
9 /** 8 /**
10 * Synchronizes the element's checked state with its ripple effect. 9 * Synchronizes the element's checked state with its ripple effect.
11 */ 10 */
12 _checkedChanged: function() { 11 _checkedChanged: function() {
13 Polymer.IronCheckedElementBehaviorImpl._checkedChanged.call(this); 12 Polymer.IronCheckedElementBehaviorImpl._checkedChanged.call(this);
14 if (this.hasRipple()) { 13 if (this.hasRipple()) {
15 if (this.checked) { 14 if (this.checked) {
16 this._ripple.setAttribute('checked', ''); 15 this._ripple.setAttribute('checked', '');
17 } else { 16 } else {
18 this._ripple.removeAttribute('checked'); 17 this._ripple.removeAttribute('checked');
19 } 18 }
20 } 19 }
21 }, 20 },
22 21
23 /** 22 /**
24 * Synchronizes the element's `active` and `checked` state. 23 * Synchronizes the element's `active` and `checked` state.
25 */ 24 */
26 _buttonStateChanged: function() { 25 _buttonStateChanged: function() {
27 Polymer.PaperRippleBehavior._buttonStateChanged.call(this); 26 Polymer.PaperRippleBehavior._buttonStateChanged.call(this);
28 if (this.disabled) { 27 if (this.disabled) {
29 return; 28 return;
30 } 29 }
31 if (this.isAttached) { 30 if (this.isAttached) {
32 this.checked = this.active; 31 this.checked = this.active;
33 } 32 }
34 } 33 }
35
36 }; 34 };
37 35
38 /** @polymerBehavior Polymer.PaperCheckedElementBehavior */ 36 /** @polymerBehavior Polymer.PaperCheckedElementBehavior */
39 Polymer.PaperCheckedElementBehavior = [ 37 Polymer.PaperCheckedElementBehavior = [
40 Polymer.PaperInkyFocusBehavior, 38 Polymer.PaperInkyFocusBehavior,
41 Polymer.IronCheckedElementBehavior, 39 Polymer.IronCheckedElementBehavior,
42 Polymer.PaperCheckedElementBehaviorImpl 40 Polymer.PaperCheckedElementBehaviorImpl
43 ]; 41 ];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698