-
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.
refactor: Improved code style respecting ESLint rules
- Loading branch information
1 parent
e917ef3
commit b495543
Showing
4 changed files
with
427 additions
and
406 deletions.
There are no files selected for viewing
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,40 +1,42 @@ | ||
(() => { | ||
ESX = {}; | ||
ESX = {}; | ||
|
||
ESX.inventoryNotification = function (add, label, count) { | ||
let notif = ""; | ||
ESX.inventoryNotification = function(add, label, count) { | ||
let notif = ''; | ||
|
||
if (add) { | ||
notif += "+"; | ||
} else { | ||
notif += "-"; | ||
} | ||
if (add) { | ||
notif += '+'; | ||
} | ||
else { | ||
notif += '-'; | ||
} | ||
|
||
if (count) { | ||
notif += count + " " + label; | ||
} else { | ||
notif += " " + label; | ||
} | ||
if (count) { | ||
notif += count + ' ' + label; | ||
} | ||
else { | ||
notif += ' ' + label; | ||
} | ||
|
||
let elem = $("<div>" + notif + "</div>"); | ||
$("#inventory_notifications").append(elem); | ||
const elem = $('<div>' + notif + '</div>'); | ||
$('#inventory_notifications').append(elem); | ||
|
||
$(elem) | ||
.delay(3000) | ||
.fadeOut(1000, function () { | ||
elem.remove(); | ||
}); | ||
}; | ||
$(elem) | ||
.delay(3000) | ||
.fadeOut(1000, function() { | ||
elem.remove(); | ||
}); | ||
}; | ||
|
||
window.onData = (data) => { | ||
if (data.action === "inventoryNotification") { | ||
ESX.inventoryNotification(data.add, data.item, data.count); | ||
} | ||
}; | ||
window.onData = (data) => { | ||
if (data.action === 'inventoryNotification') { | ||
ESX.inventoryNotification(data.add, data.item, data.count); | ||
} | ||
}; | ||
|
||
window.onload = function (e) { | ||
window.addEventListener("message", (event) => { | ||
onData(event.data); | ||
}); | ||
}; | ||
window.onload = function() { | ||
window.addEventListener('message', (event) => { | ||
onData(event.data); | ||
}); | ||
}; | ||
})(); |
Oops, something went wrong.