| Index: polymer_0.5.0/bower_components/paper-button/paper-button-base.html
|
| diff --git a/bower_components/paper-button/paper-button-base.html b/polymer_0.5.0/bower_components/paper-button/paper-button-base.html
|
| similarity index 64%
|
| rename from bower_components/paper-button/paper-button-base.html
|
| rename to polymer_0.5.0/bower_components/paper-button/paper-button-base.html
|
| index cfbad280c016952f948f53566a9d261ee2725640..8f62aa72e448b9b784067bc783bd7d73246c29ba 100644
|
| --- a/bower_components/paper-button/paper-button-base.html
|
| +++ b/polymer_0.5.0/bower_components/paper-button/paper-button-base.html
|
| @@ -13,46 +13,50 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
| `paper-button-base` is the base class for button-like elements with ripple and optional shadow.
|
|
|
| @element paper-button-base
|
| -@extends paper-focusable
|
| +@mixins Polymer.CoreFocusable
|
| @status unstable
|
| -->
|
|
|
| <link href="../polymer/polymer.html" rel="import">
|
| -<link href="../paper-focusable/paper-focusable.html" rel="import">
|
| +<link href="../core-focusable/core-focusable.html" rel="import">
|
| +<link href="../paper-ripple/paper-ripple.html" rel="import">
|
|
|
| -<polymer-element name="paper-button-base" extends="paper-focusable">
|
| +<polymer-element name="paper-button-base" tabindex="0">
|
|
|
| - <script>
|
| - Polymer({
|
| +<script>
|
|
|
| - z: 1,
|
| + (function() {
|
| +
|
| + var p = {
|
| +
|
| + eventDelegates: {
|
| + down: 'downAction'
|
| + },
|
|
|
| activeChanged: function() {
|
| this.super();
|
|
|
| - if (this.active) {
|
| - // FIXME: remove when paper-ripple can have a default 'down' state.
|
| - if (!this.lastEvent) {
|
| - var rect = this.getBoundingClientRect();
|
| - this.lastEvent = {
|
| - x: rect.left + rect.width / 2,
|
| - y: rect.top + rect.height / 2
|
| + if (this.$.ripple) {
|
| + if (this.active) {
|
| + // FIXME: remove when paper-ripple can have a default 'down' state.
|
| + if (!this.lastEvent) {
|
| + var rect = this.getBoundingClientRect();
|
| + this.lastEvent = {
|
| + x: rect.left + rect.width / 2,
|
| + y: rect.top + rect.height / 2
|
| + }
|
| }
|
| + this.$.ripple.downAction(this.lastEvent);
|
| + } else {
|
| + this.$.ripple.upAction();
|
| }
|
| - this.$.ripple.downAction(this.lastEvent);
|
| - } else {
|
| - this.$.ripple.upAction();
|
| }
|
| +
|
| this.adjustZ();
|
| },
|
|
|
| disabledChanged: function() {
|
| - this.super();
|
| - if (this.disabled) {
|
| - this.setAttribute('aria-disabled', '');
|
| - } else {
|
| - this.removeAttribute('aria-disabled');
|
| - }
|
| + this._disabledChanged();
|
| this.adjustZ();
|
| },
|
|
|
| @@ -69,17 +73,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
| },
|
|
|
| adjustZ: function() {
|
| + if (!this.$.shadow) {
|
| + return;
|
| + }
|
| if (this.active) {
|
| - this.z = 2;
|
| + this.$.shadow.setZ(2);
|
| } else if (this.disabled) {
|
| - this.z = 0;
|
| + this.$.shadow.setZ(0);
|
| } else {
|
| - this.z = 1;
|
| + this.$.shadow.setZ(1);
|
| }
|
| },
|
|
|
| downAction: function(e) {
|
| - this.super(e);
|
| + this._downAction();
|
| +
|
| + if (this.hasAttribute('noink')) {
|
| + return;
|
| + }
|
| +
|
| this.lastEvent = e;
|
| if (!this.$.ripple) {
|
| var ripple = document.createElement('paper-ripple');
|
| @@ -98,6 +110,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
| }
|
| }
|
|
|
| - });
|
| - </script>
|
| + };
|
| +
|
| + Polymer.mixin2(p, Polymer.CoreFocusable);
|
| + Polymer(p);
|
| +
|
| + })();
|
| +
|
| +</script>
|
| </polymer-element>
|
|
|