3
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
Code distributed by Google as part of the polymer project is also
8
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
11
<link rel="import" href="../polymer/polymer.html">
12
<link rel="import" href="../iron-checked-element-behavior/iron-checked-element-behavior.html">
13
<link rel="import" href="paper-inky-focus-behavior.html">
18
* Use `Polymer.PaperCheckedElementBehavior` to implement a custom element
19
* that has a `checked` property similar to `Polymer.IronCheckedElementBehavior`
20
* and is compatible with having a ripple effect.
21
* @polymerBehavior Polymer.PaperCheckedElementBehavior
23
Polymer.PaperCheckedElementBehaviorImpl = {
26
* Synchronizes the element's checked state with its ripple effect.
28
_checkedChanged: function() {
29
Polymer.IronCheckedElementBehaviorImpl._checkedChanged.call(this);
30
if (this.hasRipple()) {
32
this._ripple.setAttribute('checked', '');
34
this._ripple.removeAttribute('checked');
40
* Synchronizes the element's `active` and `checked` state.
42
_buttonStateChanged: function() {
43
Polymer.PaperRippleBehavior._buttonStateChanged.call(this);
47
if (this.isAttached) {
48
this.checked = this.active;
54
/** @polymerBehavior Polymer.PaperCheckedElementBehavior */
55
Polymer.PaperCheckedElementBehavior = [
56
Polymer.PaperInkyFocusBehavior,
57
Polymer.IronCheckedElementBehavior,
58
Polymer.PaperCheckedElementBehaviorImpl