OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 @license |
| 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.g
ithub.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/CONTRI
BUTORS.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/PATEN
TS.txt |
| 9 --> |
| 10 |
| 11 <link rel="import" href="../../polymer/polymer.html"> |
| 12 <link rel="import" href="../../paper-card/paper-card.html"> |
| 13 <link rel="import" href="../paper-button-behavior.html"> |
| 14 |
| 15 <dom-module id="paper-button"> |
| 16 |
| 17 <style> |
| 18 |
| 19 :host { |
| 20 display: inline-block; |
| 21 background-color: #4285F4; |
| 22 color: #fff; |
| 23 border-radius: 3px; |
| 24 text-transform: uppercase; |
| 25 outline: none; |
| 26 -moz-user-select: none; |
| 27 -ms-user-select: none; |
| 28 -webkit-user-select: none; |
| 29 user-select: none; |
| 30 cursor: pointer; |
| 31 } |
| 32 |
| 33 paper-card { |
| 34 border-radius: inherit; |
| 35 padding: 16px; |
| 36 } |
| 37 |
| 38 :host([disabled]) { |
| 39 opacity: 0.3; |
| 40 pointer-events: none; |
| 41 } |
| 42 |
| 43 :host([active]), |
| 44 :host([pressed]) { |
| 45 background-color: #3367D6; |
| 46 box-shadow: inset 0 3px 5px rgba(0,0,0,.2); |
| 47 } |
| 48 |
| 49 </style> |
| 50 |
| 51 <template> |
| 52 |
| 53 <paper-card class="content" elevation="[[_elevation]]" animated> |
| 54 <content></content> |
| 55 </paper-card> |
| 56 |
| 57 </template> |
| 58 |
| 59 <script> |
| 60 |
| 61 Polymer({ |
| 62 |
| 63 behaviors: [ |
| 64 Polymer.PaperButtonBehavior |
| 65 ], |
| 66 |
| 67 ready: function() { |
| 68 this.raised = true; |
| 69 if (!this.hasAttribute('role')) { |
| 70 this.setAttribute('role', 'button'); |
| 71 } |
| 72 }, |
| 73 |
| 74 _buttonStateChanged: function() { |
| 75 this._calculateElevation(); |
| 76 } |
| 77 |
| 78 }); |
| 79 |
| 80 </script> |
| 81 |
| 82 </dom-module> |
OLD | NEW |