Minor cleanup (unnecessary functions, array prototype calls)

This commit is contained in:
chylex 2018-09-19 14:41:33 +02:00
parent 3ca345b26f
commit 2e3c709459
3 changed files with 2 additions and 12 deletions

View File

@ -87,7 +87,7 @@ var DISCORD = (function(){
return null;
}
var name = [].find.call(channel.querySelector("[class|='name']").childNodes, node => node.nodeType === Node.TEXT_NODE).nodeValue;
var name = Array.prototype.find.call(channel.querySelector("[class|='name']").childNodes, node => node.nodeType === Node.TEXT_NODE).nodeValue;
obj = {
"server": name,

View File

@ -13,16 +13,6 @@ var DOM = (function(){
*/
id: (id, parent) => (parent || document).getElementById(id),
/*
* Returns the first child element containing the specified class. Parent defaults to the entire document.
*/
fcls: (cls, parent) => (parent || document).getElementsByClassName(cls)[0],
/*
* Returns the first child element that has the specified tag. Parent defaults to the entire document.
*/
ftag: (tag, parent) => (parent || document).getElementsByTagName(tag)[0],
/*
* Returns the first child element containing the specified obfuscated class. Parent defaults to the entire document.
*/

View File

@ -147,7 +147,7 @@ ${btn("close", "X")}`);
});
DOM.listen(controller.ui.inputUpload, "change", () => {
[].forEach.call(controller.ui.inputUpload.files, file => {
Array.prototype.forEach.call(controller.ui.inputUpload.files, file => {
var reader = new FileReader();
reader.onload = function(){