Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
fix: variable types
Browse files Browse the repository at this point in the history
  • Loading branch information
BerkieBb committed Apr 20, 2022
1 parent 002afb6 commit 61449da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ local function EnableTarget()
end

RegisterNUICallback('selectTarget', function(option)
option = tonumber(option) or option
SetNuiFocus(false, false)
SetNuiFocusKeepInput(false)
Wait(100)
Expand Down
5 changes: 3 additions & 2 deletions html/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ window.addEventListener('message', function (event) {
} else if (item.response == 'validTarget') {
$('.target-label').html('');

for (const index in item.data) {
for (let index in item.data) {
const itemData = item.data[index];
const numberTest = Number(index);
if (!isNaN(numberTest)) index = numberTest + 1;
$('.target-label').append(
`<div class='target-item' id='${index}'><i class='${item.data[index].icon} fa-fw fa-pull-left target-icon'></i>${item.data[index].label}</div>`
`<div class='target-item' id='${index}'><i class='${itemData.icon} fa-fw fa-pull-left target-icon'></i>${itemData.label}</div>`
);
$(`#target-${index}`).hover((e) => {
$(`#target-${index}`).css('color', e.type === 'mouseenter' ? 'rgb(98, 135, 236)' : 'white');
Expand Down

0 comments on commit 61449da

Please sign in to comment.