improvements, fixes
This commit is contained in:
parent
b6ffbb6ced
commit
ec55100b1d
|
|
@ -67,7 +67,7 @@
|
|||
MessageType: messageType,
|
||||
SenderId: senderId,
|
||||
RequestCount: window.RequestCount,
|
||||
RequestId: getRequestId(),
|
||||
RequestId: window.getRequestId(),
|
||||
Data: messageWrapperData
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,13 @@
|
|||
if (publicProductBidBox) {
|
||||
//var audio = new Audio('../Plugins/Misc.AuctionPlugin/Content/ding.mp3');
|
||||
//audio.play();
|
||||
refreshPublicBidBox(bidNotification, messageWrapper.RequestId == window.getRequestId());
|
||||
|
||||
var lastRequestId = window.getRequestId();
|
||||
var isMyRequest = messageWrapper.requestId == lastRequestId;
|
||||
|
||||
console.log("isMyRequest: " + isMyRequest + "; lastRequestId: " + lastRequestId + "; messageWrapper.RequestId: " + messageWrapper.requestId);
|
||||
|
||||
refreshPublicBidBox(bidNotification, isMyRequest);
|
||||
}
|
||||
if (publicInfo) {
|
||||
var functionName = "refreshPublicInfo" + productToAuctionDto.productId;
|
||||
|
|
|
|||
|
|
@ -372,9 +372,6 @@
|
|||
// bidNotification.AuctionDto.
|
||||
// }
|
||||
|
||||
//TODO: KINYOMOZNI! valamiért mindig false a updateBidButtonDisabledState és emiatt nem állítja a button disabled-eket... - J.
|
||||
updateBidButtonDisabledState = true;
|
||||
|
||||
var widgetPriceElement = document.getElementById("price-value-" + bidBoxPageViewModel.ProductId);
|
||||
var currency = bidBoxPageViewModel.WorkingCurrency;
|
||||
console.log(currency);
|
||||
|
|
@ -423,8 +420,9 @@
|
|||
widgetPriceElement.textContent = HUFFormatter.format(bidNotification.currentPrice); // Update the price
|
||||
licitStepElement.textContent = HUFFormatter.format(bidNotification.nextStepAmount);
|
||||
}
|
||||
|
||||
bidBoxPageViewModel.NextBidPrice = Number(bidNotification.nextBidPrice);
|
||||
setBidButtonDisabled(bidButtonElement, false, updateBidButtonDisabledState);
|
||||
setBidButtonDisabled(bidButtonElement, !productToAuction.isActiveItem, updateBidButtonDisabledState);
|
||||
|
||||
var list;
|
||||
if (isMyBid) {
|
||||
|
|
@ -432,11 +430,13 @@
|
|||
list = bidBox.classList;
|
||||
list.add("bg-success");
|
||||
list.remove("bg-primary");
|
||||
|
||||
bidButtonElement.textContent = "@(T("Plugins.Misc.AuctionPlugin.GoodJob"))";
|
||||
bidBoxTitle.textContent = productToAuction.auctionStatus == AuctionStatus.Sold ? "@(T("Plugins.Misc.AuctionPlugin.YouWin"))" : "@(T("Plugins.Misc.AuctionPlugin.YourBidLeading"))";
|
||||
|
||||
if (bidBoxPageViewModel.IsAdmin) {
|
||||
console.log("I AM WEASEL!!! " + bidBoxPageViewModel.IsAdmin);
|
||||
setBidButtonDisabled(bidButtonElement, false, updateBidButtonDisabledState);
|
||||
setBidButtonDisabled(bidButtonElement, !productToAuction.isActiveItem, updateBidButtonDisabledState);
|
||||
} else {
|
||||
console.log("I AM NOT WEASEL!!! " + bidBoxPageViewModel.IsAdmin);
|
||||
setBidButtonDisabled(bidButtonElement, true, updateBidButtonDisabledState);
|
||||
|
|
@ -446,26 +446,21 @@
|
|||
list.add("bg-primary");
|
||||
list.remove("bg-success");
|
||||
bidBoxTitle.textContent = productToAuction.auctionStatus == AuctionStatus.Sold ? "@(T("Plugins.Misc.AuctionPlugin.Sold"))" : "@(T("Plugins.Misc.AuctionPlugin.PlaceABid"))";
|
||||
|
||||
if (bidBoxPageViewModel.WorkingCurrency.CurrencyCode == "EUR") {
|
||||
bidButtonElement.textContent = "@(T("Plugins.Misc.AuctionPlugin.BidButtonPrefix")) " + EURFormatter.format(bidBoxPageViewModel.NextBidPriceInWorkingCurrency);
|
||||
} else {
|
||||
bidButtonElement.textContent = "@(T("Plugins.Misc.AuctionPlugin.BidButtonPrefix")) " + HUFFormatter.format(bidBoxPageViewModel.NextBidPrice);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
console.log(`WidgetPrice updated to: ${bidNotification.currentPrice}, next bid is ${bidBoxPageViewModel.NextBidPrice}`);
|
||||
//bidButtonElement.disabled = false;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
console.log("Not for this product");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
console.warn("Element with ID 'WidgetPrice' not found in the DOM.");
|
||||
}
|
||||
|
|
@ -516,8 +511,7 @@
|
|||
case AuctionStatus.Active:
|
||||
if (isMyBid) {
|
||||
bidBoxTitle.textContent = "@(T("Plugins.Misc.AuctionPlugin.YourBidLeading"))";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
bidBoxTitle.textContent = "@(T("Plugins.Misc.AuctionPlugin.PlaceABid"))";
|
||||
}
|
||||
break;
|
||||
|
|
@ -537,8 +531,7 @@
|
|||
case AuctionStatus.Sold:
|
||||
if (isMyBid) {
|
||||
bidBoxTitle.textContent = "@(T("Plugins.Misc.AuctionPlugin.YouWin"))";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
bidBoxTitle.textContent = "@(T("Plugins.Misc.AuctionPlugin.ItemClosed"))";
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue