-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #924 from bitpredator/dev
fix: correct eslint error
- Loading branch information
Showing
1 changed file
with
19 additions
and
19 deletions.
There are no files selected for viewing
38 changes: 19 additions & 19 deletions
38
server-data/resources/[ox]/ox_target/web/js/createOptions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |