|
| 1 | +<link rel="import" href="../../bower_components/polymer/polymer.html"> |
| 2 | +<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout-classes.html"> |
| 3 | +<link rel="import" href="../../bower_components/iron-icon/iron-icon.html"> |
| 4 | + |
| 5 | +<link rel="import" href="lancie-admin-committee-icons.html"> |
| 6 | + |
| 7 | +<dom-module id="lancie-admin-committee-member"> |
| 8 | + <template> |
| 9 | + <style> |
| 10 | + :host { |
| 11 | + display: block; |
| 12 | + } |
| 13 | + |
| 14 | + iron-icon { |
| 15 | + margin-right: 10px; |
| 16 | + } |
| 17 | + |
| 18 | + .delete-button { |
| 19 | + cursor: pointer; |
| 20 | + } |
| 21 | + |
| 22 | + .align-right { |
| 23 | + text-align: right; |
| 24 | + } |
| 25 | + </style> |
| 26 | + |
| 27 | + <custom-style> |
| 28 | + <style is="custom-style"> |
| 29 | + .flex-horizontal-with-ratios { |
| 30 | + @apply (--layout-horizontal); |
| 31 | + } |
| 32 | + .flexchild { |
| 33 | + @apply (--layout-flex); |
| 34 | + } |
| 35 | + .flex2child { |
| 36 | + @apply (--layout-flex-4); |
| 37 | + } |
| 38 | + .flex3child { |
| 39 | + @apply (--layout-flex-9); |
| 40 | + } |
| 41 | + </style> |
| 42 | + </custom-style> |
| 43 | + |
| 44 | + <paper-item class="container flex-horizontal-with-ratios"> |
| 45 | + <div class="flex2child">[[member.name]]</div> |
| 46 | + <div class="flex3child"> |
| 47 | + <iron-icon icon="commission:[[member.icon]]"></iron-icon>[[member.function]] |
| 48 | + </div> |
| 49 | + <div class="flexchild">[[member.position]]</div> |
| 50 | + <div class="flexchild align-right"> |
| 51 | + <iron-icon icon="icons:delete" on-tap="deleteMemberDialog" class="delete-button"></iron-icon> |
| 52 | + </div> |
| 53 | + </paper-item> |
| 54 | + |
| 55 | + </template> |
| 56 | + <script> |
| 57 | + (function() { |
| 58 | + 'use strict'; |
| 59 | + |
| 60 | + class LancieAdminCommitteeMember extends Polymer.Element { |
| 61 | + static get is() { |
| 62 | + return 'lancie-admin-committee-member'; |
| 63 | + } |
| 64 | + |
| 65 | + static get properties() { |
| 66 | + return { |
| 67 | + member: Object |
| 68 | + } |
| 69 | + } |
| 70 | + |
| 71 | + deleteMemberDialog() { |
| 72 | + this.dispatchEvent(new CustomEvent('delete-member-dialog', { |
| 73 | + detail: { |
| 74 | + position: this.member.position |
| 75 | + }, |
| 76 | + bubbles: true, |
| 77 | + composed: true |
| 78 | + })); |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + customElements.define(LancieAdminCommitteeMember.is, LancieAdminCommitteeMember); |
| 83 | + })(); |
| 84 | + </script> |
| 85 | +</dom-module> |
0 commit comments