Skip to content

Commit

Permalink
Merge pull request #924 from bitpredator/dev
Browse files Browse the repository at this point in the history
fix: correct eslint error
  • Loading branch information
bitpredator authored Dec 16, 2024
2 parents d8d57f5 + 53c00ee commit 5a7b985
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions server-data/resources/[ox]/ox_target/web/js/createOptions.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { fetchNui } from "./fetchNui.js";
import { fetchNui } from './fetchNui.js';

const optionsWrapper = document.getElementById("options-wrapper");
const optionsWrapper = document.getElementById('options-wrapper');

function onClick() {
// when nuifocus is disabled after a click, the hover event is never released
this.style.pointerEvents = "none";
// when nuifocus is disabled after a click, the hover event is never released
this.style.pointerEvents = 'none';

fetchNui("select", [this.targetType, this.targetId, this.zoneId]);
// is there a better way to handle this? probably
setTimeout(() => (this.style.pointerEvents = "auto"), 100);
fetchNui('select', [this.targetType, this.targetId, this.zoneId]);
// is there a better way to handle this? probably
setTimeout(() => (this.style.pointerEvents = 'auto'), 100);
}

export function createOptions(type, data, id, zoneId) {
if (data.hide) return;
if (data.hide) return;

const option = document.createElement("div");
const iconElement = `<i class="fa-fw ${data.icon} option-icon" ${
data.iconColor ? `style = color:${data.iconColor} !important` : null
}"></i>`;
const option = document.createElement('div');
const iconElement = `<i class="fa-fw ${data.icon} option-icon" ${
data.iconColor ? `style = color:${data.iconColor} !important` : null
}"></i>`;

option.innerHTML = `${iconElement}<p class="option-label">${data.label}</p>`;
option.className = "option-container";
option.targetType = type;
option.targetId = id;
option.zoneId = zoneId;
option.innerHTML = `${iconElement}<p class="option-label">${data.label}</p>`;
option.className = 'option-container';
option.targetType = type;
option.targetId = id;
option.zoneId = zoneId;

option.addEventListener("click", onClick);
optionsWrapper.appendChild(option);
option.addEventListener('click', onClick);
optionsWrapper.appendChild(option);
}

0 comments on commit 5a7b985

Please sign in to comment.