fixed cancel trade button onclick error
This commit is contained in:
parent
c2c95789f1
commit
d23b602db7
@ -20283,20 +20283,32 @@
|
||||
const currency = myOrdersData.currency;
|
||||
const order_type = myOrdersData.order_type;
|
||||
const product = myOrdersData.product;
|
||||
|
||||
//const status = status
|
||||
const RM_TRADE = new localbitcoinplusplus.trade;
|
||||
|
||||
t +=
|
||||
`<li>Trade Id: ${trade_id}</li>
|
||||
<li>Type Of Order: ${order_type}</li>
|
||||
<li>Product: ${product}</li>
|
||||
<li>Price: ${price}</li>
|
||||
<li>Currency: ${currency}</li>
|
||||
<li><button class='button bg-red fs-16 mg-5' onclick="RM_TRADE.cancelTrade('${trade_id}', '${flo_id}', '${order_type}')">Cancel Trade</button></li>
|
||||
<li><hr></li>
|
||||
`;
|
||||
<li>Type Of Order: ${order_type}</li>
|
||||
<li>Product: ${product}</li>
|
||||
<li>Price: ${price}</li>
|
||||
<li>Currency: ${currency}</li>
|
||||
<li><button class='button bg-red fs-16 mg-5 CANCEL_TRADE'
|
||||
id='${trade_id}-${flo_id}-${order_type}'> Cancel Trade</button></li>
|
||||
<li><hr></li>
|
||||
`;
|
||||
|
||||
});
|
||||
t += `</ul>`;
|
||||
my_trades_div.innerHTML = t;
|
||||
|
||||
var delclassname = document.getElementsByClassName("CANCEL_TRADE");
|
||||
|
||||
Array.from(delclassname).forEach(function(element) {
|
||||
element.addEventListener('click', function() {
|
||||
let cancel_td = this.id;
|
||||
let trade_opts = cancel_td.split('-');
|
||||
RM_TRADE.cancelTrade(trade_opts[0], trade_opts[1], trade_opts[2]);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user