From fe9b972c8079b2638f789f12b1466afdb558addd Mon Sep 17 00:00:00 2001 From: David Kelly Date: Fri, 21 Sep 2018 15:46:57 -0700 Subject: [PATCH] Do not have active buy button on invalidated items --- scripts/system/html/js/marketplacesInject.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 3239105254..3c18832e11 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -316,12 +316,16 @@ if ($this.text() === buyString || $this.text() === getString) { return; } + if ($this.text() === 'invalidated') { + return; + } $this.data('initialHtml', $this.html()); var cost = $(this).parent().siblings().text(); if (parseInt(cost) > 0) { $this.text(buyString); - } else { + } + if (parseInt(cost) == 0) { $this.text(getString); } }); @@ -333,6 +337,9 @@ $('.grid-item').find('#price-or-edit').find('a').on('click', function () { + if ($(this).closest('.grid-item').find('.price').text() === 'invalidated') { + return false; + } buyButtonClicked($(this).closest('.grid-item').attr('data-item-id'), $(this).closest('.grid-item').find('.item-title').text(), $(this).closest('.grid-item').find('.creator').find('.value').text(),