From ed99da2165ab7c0938508e0525c13ec43eed4050 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 10 Dec 2018 11:15:27 -0800 Subject: [PATCH] Fix MS20215: Fix incorrect display of unavailable items on Marketplace main page --- scripts/system/html/js/marketplacesInject.js | 40 +++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index e3da1c2577..f1931192e4 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -251,19 +251,39 @@ $(this).closest('.col-xs-3').attr("class", 'col-xs-6'); var priceElement = $(this).find('.price'); - priceElement.css({ - "padding": "3px 5px", - "height": "40px", - "background": "linear-gradient(#00b4ef, #0093C5)", - "color": "#FFF", - "font-weight": "600", - "line-height": "34px" - }); + var available = true; + + if (priceElement.text() === 'invalidated' || + priceElement.text() === 'sold out' || + priceElement.text() === 'not for sale') { + available = false; + priceElement.css({ + "padding": "3px 5px 10px 5px", + "height": "40px", + "background": "linear-gradient(#a2a2a2, #fefefe)", + "color": "#000", + "font-weight": "600", + "line-height": "34px" + }); + } else { + priceElement.css({ + "padding": "3px 5px", + "height": "40px", + "background": "linear-gradient(#00b4ef, #0093C5)", + "color": "#FFF", + "font-weight": "600", + "line-height": "34px" + }); + } if (parseInt(cost) > 0) { priceElement.css({ "width": "auto" }); - priceElement.html(' ' + cost); + + if (available) { + priceElement.html(' ' + cost); + } + priceElement.css({ "min-width": priceElement.width() + 30 }); } });