messageHandler update
This commit is contained in:
parent
8ad64ac523
commit
7f39d3dcdd
|
|
@ -22,13 +22,11 @@
|
|||
$('.toast-info').css("background-color", "#008080");
|
||||
},
|
||||
bidNotification: function (data) {
|
||||
//console.log("Bid product name" + data.productName);
|
||||
toastr.success(`<div class="item bidToast"><p>${data.bidPrice}</p><p>${data.productName}</p></div>`, "New bid arrived", {
|
||||
//"timeOut": 150000,
|
||||
"closeButton": true,
|
||||
"positionClass": "toast-bottom-right",
|
||||
"newestOnTop": true,
|
||||
"progressBar": true,
|
||||
"progressBar": true,
|
||||
"preventDuplicates": false,
|
||||
"onclick": null,
|
||||
"showDuration": "30000",
|
||||
|
|
@ -39,10 +37,18 @@
|
|||
"hideEasing": "linear",
|
||||
"showMethod": animation,
|
||||
"hideMethod": "fadeOut"
|
||||
|
||||
});
|
||||
$('.toast-success').css("background-color", "#4caf50");
|
||||
},
|
||||
auctionUpdate: function (data) {
|
||||
const widgetPriceElement = document.getElementById("WidgetPrice");
|
||||
if (widgetPriceElement) {
|
||||
widgetPriceElement.textContent = data.bidPrice; // Update the price
|
||||
console.log(`WidgetPrice updated to: ${data.bidPrice}`);
|
||||
} else {
|
||||
console.warn("Element with ID 'WidgetPrice' not found in the DOM.");
|
||||
}
|
||||
},
|
||||
// Add more handlers as needed
|
||||
default: function (data) {
|
||||
console.warn("Unhandled message type:", data);
|
||||
|
|
@ -53,7 +59,6 @@
|
|||
function messageRouter(message) {
|
||||
// Parse the JSON message
|
||||
try {
|
||||
/*console.log(message);*/
|
||||
const parsedMessage = JSON.parse(message);
|
||||
const messageType = parsedMessage.messageType;
|
||||
const messageData = parsedMessage.data;
|
||||
|
|
|
|||
Loading…
Reference in New Issue