Toggle metadata visibility by clicking name
This commit is contained in:
@@ -3,6 +3,20 @@ import Ember from 'ember';
|
|||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
||||||
tagName: 'table',
|
tagName: 'table',
|
||||||
classNames: 'contributor-list'
|
classNames: 'contributor-list',
|
||||||
|
selectedContributor: null,
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
|
||||||
|
toggleContributorInfo(contributor) {
|
||||||
|
if (contributor.get('showMetadata')) {
|
||||||
|
contributor.set('showMetadata', false);
|
||||||
|
} else {
|
||||||
|
this.get('contributors').setEach('showMetadata', false);
|
||||||
|
contributor.set('showMetadata', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{#each contributors as |contributor|}}
|
{{#each contributors as |contributor|}}
|
||||||
<tr class="{{if contributor.isCurrentUser 'current-user'}}">
|
<tr class="{{if contributor.isCurrentUser 'current-user'}}" {{action "toggleContributorInfo" contributor}}>
|
||||||
<td class="person">
|
<td class="person">
|
||||||
<img class="avatar" src={{contributor.avatarURL}}>
|
<img class="avatar" src={{contributor.avatarURL}}>
|
||||||
{{contributor.github_username}}
|
{{contributor.github_username}}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<span class="symbol">₭S</span>
|
<span class="symbol">₭S</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="metadata visible {{if contributor.isCurrentUser 'current-user'}}">
|
<tr class="metadata {{if contributor.isCurrentUser 'current-user'}} {{if contributor.showMetadata 'visible'}}">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Ethereum address</dt>
|
<dt>Ethereum address</dt>
|
||||||
|
|||||||
Reference in New Issue
Block a user