Show details when trade is selected

This commit is contained in:
Matthias 2020-08-29 10:52:33 +02:00
parent c2d8d67625
commit ae6f5935b5

View File

@ -10,10 +10,12 @@
:emptyText="emptyText"
:per-page="perPage"
:current-page="currentPage"
selectable
select-mode="single"
@row-selected="onRowSelected"
>
<template v-slot:cell(actions)="row">
<b-button size="sm" @click="forcesellHandler(row.item)"> FS </b-button>
<b-button size="sm" @click="showDetails(row.item)">D</b-button>
<b-button size="sm" @click="removeTradeHandler(row.item)">RM</b-button>
</template>
<template v-slot:cell(pair)="row">
@ -123,11 +125,12 @@ export default class TradeList extends Vue {
});
}
showDetails(trade) {
if (this.detailTradeId === trade.trade_id) {
this.setDetailTrade(null);
onRowSelected(items) {
// Only allow single selection mode!
if (items.length > 0) {
this.setDetailTrade(items[0]);
} else {
this.setDetailTrade(trade);
this.setDetailTrade(null);
}
}
}