11 activeChanged: function() {
16 // FIXME: remove when paper-ripple can have a default 'down' state.
17 if (!this.lastEvent) {
18 var rect = this.getBoundingClientRect();
20 x: rect.left + rect.width / 2,
21 y: rect.top + rect.height / 2
24 this.$.ripple.downAction(this.lastEvent);
26 this.$.ripple.upAction();
33 disabledChanged: function() {
34 this._disabledChanged();
38 recenteringTouchChanged: function() {
40 this.$.ripple.classList.toggle('recenteringTouch', this.recenteringTouch);
44 fillChanged: function() {
46 this.$.ripple.classList.toggle('fill', this.fill);
55 this.$.shadow.setZ(2);
56 } else if (this.disabled) {
57 this.$.shadow.setZ(0);
59 this.$.shadow.setZ(1);
63 downAction: function(e) {
66 if (this.hasAttribute('noink')) {
72 var ripple = document.createElement('paper-ripple');
73 ripple.setAttribute('id', 'ripple');
74 ripple.setAttribute('fit', '');
75 if (this.recenteringTouch) {
76 ripple.classList.add('recenteringTouch');
79 ripple.classList.add('circle');
81 this.$.ripple = ripple;
82 this.shadowRoot.insertBefore(ripple, this.shadowRoot.firstChild);
83 // No need to forward the event to the ripple because the ripple
84 // is triggered in activeChanged
90 Polymer.mixin2(p, Polymer.CoreFocusable);
91 Polymer('paper-button-base',p);