mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:30:42 +02:00
Merge pull request #14299 from davidkelly/dk/19591
Don't attempt purchase of sold out items
This commit is contained in:
commit
03ac18ab74
1 changed files with 10 additions and 6 deletions
|
@ -280,11 +280,12 @@
|
||||||
var getString = "GET";
|
var getString = "GET";
|
||||||
// Protection against the button getting stuck in the "BUY"/"GET" state.
|
// Protection against the button getting stuck in the "BUY"/"GET" state.
|
||||||
// That happens when the browser gets two MOUSEENTER events before getting a
|
// That happens when the browser gets two MOUSEENTER events before getting a
|
||||||
// MOUSELEAVE event.
|
// MOUSELEAVE event. Also, if not available for sale, just return.
|
||||||
if ($this.text() === buyString || $this.text() === getString) {
|
if ($this.text() === buyString ||
|
||||||
return;
|
$this.text() === getString ||
|
||||||
}
|
$this.text() === 'invalidated' ||
|
||||||
if ($this.text() === 'invalidated') {
|
$this.text() === 'sold out' ||
|
||||||
|
$this.text() === 'not for sale' ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this.data('initialHtml', $this.html());
|
$this.data('initialHtml', $this.html());
|
||||||
|
@ -305,7 +306,10 @@
|
||||||
|
|
||||||
|
|
||||||
$('.grid-item').find('#price-or-edit').find('a').on('click', function () {
|
$('.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;
|
return false;
|
||||||
}
|
}
|
||||||
buyButtonClicked($(this).closest('.grid-item').attr('data-item-id'),
|
buyButtonClicked($(this).closest('.grid-item').attr('data-item-id'),
|
||||||
|
|
Loading…
Reference in a new issue