mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
Perfrormance improvements, removed marker code
This commit is contained in:
+8
-3
@@ -1,5 +1,4 @@
|
||||
$(window).ready(function () {
|
||||
// NUI Callback
|
||||
window.addEventListener('message', function (event) {
|
||||
let data = event.data;
|
||||
|
||||
@@ -7,12 +6,14 @@ $(window).ready(function () {
|
||||
$('#container').fadeIn();
|
||||
$('#menu').fadeIn();
|
||||
$('#deposit_amount').val(data.player.money);
|
||||
|
||||
let bankAmount = 0;
|
||||
for (let i = 0; i < data.player.accounts.length; i++) {
|
||||
if (data.player.accounts[i].name == 'bank') {
|
||||
bankAmount = data.player.accounts[i].money;
|
||||
}
|
||||
}
|
||||
|
||||
$('#withdraw_amount').val(bankAmount);
|
||||
} else if (data.hideAll) {
|
||||
$('#container').fadeOut();
|
||||
@@ -31,14 +32,16 @@ $(window).ready(function () {
|
||||
$.post('http://esx_atm/deposit', JSON.stringify({
|
||||
amount: $('#deposit_amount').val()
|
||||
}));
|
||||
|
||||
$('#deposit_amount').val(0);
|
||||
})
|
||||
|
||||
$('#deposit_amount').on("keyup", function(e) {
|
||||
$('#deposit_amount').on("keyup", function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
$.post('http://esx_atm/deposit', JSON.stringify({
|
||||
amount: $('#deposit_amount').val()
|
||||
}));
|
||||
|
||||
$('#deposit_amount').val(0);
|
||||
}
|
||||
});
|
||||
@@ -47,14 +50,16 @@ $(window).ready(function () {
|
||||
$.post('http://esx_atm/withdraw', JSON.stringify({
|
||||
amount: $('#withdraw_amount').val()
|
||||
}));
|
||||
|
||||
$('#withdraw_amount').val(0);
|
||||
});
|
||||
|
||||
$('#withdraw_amount').on("keyup", function(e) {
|
||||
$('#withdraw_amount').on("keyup", function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
$.post('http://esx_atm/withdraw', JSON.stringify({
|
||||
amount: $('#withdraw_amount').val()
|
||||
}));
|
||||
|
||||
$('#withdraw_amount').val(0);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user