OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
6 Code distributed by Google as part of the polymer project is also | 6 Code distributed by Google as part of the polymer project is also |
7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
8 --> | 8 --> |
9 | 9 |
10 <!-- | 10 <!-- |
(...skipping 16 matching lines...) Expand all Loading... |
27 color: #ff4081; | 27 color: #ff4081; |
28 } | 28 } |
29 | 29 |
30 @group Paper Elements | 30 @group Paper Elements |
31 @element paper-tab | 31 @element paper-tab |
32 @homepage github.io | 32 @homepage github.io |
33 --> | 33 --> |
34 | 34 |
35 <link rel="import" href="../paper-ripple/paper-ripple.html"> | 35 <link rel="import" href="../paper-ripple/paper-ripple.html"> |
36 | 36 |
37 <polymer-element name="paper-tab" attributes="noink" role="tab"> | 37 <polymer-element name="paper-tab" attributes="noink" role="tab" inline flex cent
er-center horizontal layout> |
38 <template> | 38 <template> |
39 | 39 |
40 <link rel="stylesheet" href="paper-tab.css"> | 40 <link rel="stylesheet" href="paper-tab.css"> |
41 | 41 |
42 <div id="tabContainer" center-justified center horizontal layout> | 42 <div class="tab-content" flex auto center-center horizontal layout><content></
content></div> |
43 | 43 <paper-ripple id="ink" initialOpacity="0.95" opacityDecayVelocity="0.98"></pap
er-ripple> |
44 <div class="tab-content"><content></content></div> | |
45 <paper-ripple id="ink" initialOpacity="0.95" opacityDecayVelocity="0.98"></p
aper-ripple> | |
46 | |
47 </div> | |
48 | 44 |
49 </template> | 45 </template> |
50 <script> | 46 <script> |
51 | 47 |
52 Polymer('paper-tab', { | 48 Polymer('paper-tab', { |
53 | 49 |
54 /** | 50 /** |
55 * If true, ink ripple effect is disabled. | 51 * If true, ink ripple effect is disabled. |
56 * | 52 * |
57 * @attribute noink | 53 * @attribute noink |
58 * @type boolean | 54 * @type boolean |
59 * @default false | 55 * @default false |
60 */ | 56 */ |
61 noink: false | 57 noink: false, |
| 58 |
| 59 eventDelegates: { |
| 60 down: 'downAction', |
| 61 up: 'upAction' |
| 62 }, |
| 63 |
| 64 downAction: function(e) { |
| 65 if (this.noink || (this.parentElement && this.parentElement.noink)) { |
| 66 return; |
| 67 } |
| 68 this.$.ink.downAction(e); |
| 69 }, |
| 70 |
| 71 upAction: function() { |
| 72 this.$.ink.upAction(); |
| 73 }, |
| 74 |
| 75 cancelRipple: function() { |
| 76 this.$.ink.upAction(); |
| 77 } |
62 | 78 |
63 }); | 79 }); |
64 | 80 |
65 </script> | 81 </script> |
66 </polymer-element> | 82 </polymer-element> |
OLD | NEW |