Skip to content

Commit

Permalink
minor UI enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketpages committed Jun 10, 2019
1 parent 3ff9640 commit c438ef6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions ui/src/components/pages/transfers/New.vue
Expand Up @@ -78,7 +78,7 @@
</b-form>
</div>
<div class="col-5">
<div class="card">
<div id="cashOnHandCard" class="card" v-bind:class="{ itemhighlight: cashOnHandHighlight == true }">
<div class="card-body">
<h4>Active Portfolio</h4>
<div class="row">
Expand Down Expand Up @@ -154,7 +154,7 @@
</td>
<td>{{ transfer.source }}</td>
<td>{{ transfer.destination }}</td>
<td>{{ transfer.amount }}</td>
<td>{{ transfer.amount | toCurrency }}</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -195,7 +195,8 @@ export default {
{ value: 'portfolio', text: 'Another portfolio' }
]
},
showDismissibleAlert: false
showDismissibleAlert: false,
cashOnHandHighlight: false
}
},
computed: {
Expand Down Expand Up @@ -236,6 +237,9 @@ export default {
this.cashOnHand = details.funds;
});
},
resetHighlight() {
setTimeout(() => this.cashOnHandHighlight = false, 5000);
},
onSubmit() {
this.submitted = true;
submitTransfer(this.form)
Expand Down Expand Up @@ -283,6 +287,9 @@ export default {
};
this.transfers.splice(index, 1, t);
this.updateCashOnHand();
// flash the 'cash on hand' card to let users know it's been updated
this.cashOnHandHighlight = true;
this.resetHighlight();
}
};
};
Expand All @@ -301,8 +308,8 @@ export default {
to { background: transparent; }
}
.item-highlight {
.itemhighlight {
animation-name: yellowfade;
animation-duration: 1.5s;
animation-duration: 2.5s;
}
</style>
3 changes: 2 additions & 1 deletion ui/src/main.js
Expand Up @@ -37,8 +37,9 @@ Vue.use(Rollbar, {
});

Vue.filter('toCurrency', function (value) {
var v = value;
if (typeof value !== "number") {
return value;
v = parseInt(value);
}
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
Expand Down

0 comments on commit c438ef6

Please sign in to comment.