mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-19 01:21:07 +02:00
Fix MS14129: Prevent Marketplace buttons from getting stuck on hover state
This commit is contained in:
parent
6794fedf5b
commit
a5ef3fa729
1 changed files with 10 additions and 2 deletions
|
@ -306,13 +306,21 @@
|
||||||
// change pricing to GET/BUY on button hover
|
// change pricing to GET/BUY on button hover
|
||||||
$('body').on('mouseenter', '#price-or-edit .price', function () {
|
$('body').on('mouseenter', '#price-or-edit .price', function () {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
var buyString = "BUY";
|
||||||
|
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;
|
||||||
|
}
|
||||||
$this.data('initialHtml', $this.html());
|
$this.data('initialHtml', $this.html());
|
||||||
|
|
||||||
var cost = $(this).parent().siblings().text();
|
var cost = $(this).parent().siblings().text();
|
||||||
if (parseInt(cost) > 0) {
|
if (parseInt(cost) > 0) {
|
||||||
$this.text('BUY');
|
$this.text(buyString);
|
||||||
} else {
|
} else {
|
||||||
$this.text('GET');
|
$this.text(getString);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue