Merge pull request #14299 from davidkelly/dk/19591

Don't attempt purchase of sold out items
This commit is contained in:
Howard Stearns 2018-11-05 16:20:02 -08:00 committed by GitHub
commit 03ac18ab74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -280,11 +280,12 @@
var getString = "GET";
// Protection against the button getting stuck in the "BUY"/"GET" state.
// That happens when the browser gets two MOUSEENTER events before getting a
// MOUSELEAVE event.
if ($this.text() === buyString || $this.text() === getString) {
return;
}
if ($this.text() === 'invalidated') {
// MOUSELEAVE event. Also, if not available for sale, just return.
if ($this.text() === buyString ||
$this.text() === getString ||
$this.text() === 'invalidated' ||
$this.text() === 'sold out' ||
$this.text() === 'not for sale' ) {
return;
}
$this.data('initialHtml', $this.html());
@ -305,7 +306,10 @@
$('.grid-item').find('#price-or-edit').find('a').on('click', function () {
if ($(this).closest('.grid-item').find('.price').text() === 'invalidated') {
var price = $(this).closest('.grid-item').find('.price').text();
if (price === 'invalidated' ||
price === 'sold out' ||
price === 'not for sale') {
return false;
}
buyButtonClicked($(this).closest('.grid-item').attr('data-item-id'),