#67 Removed obsolete list.js

This commit is contained in:
Serraniel 2020-10-08 21:05:12 +02:00
parent 0e39a6fbcc
commit 62fa39c2bf
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3
2 changed files with 0 additions and 37 deletions

View file

@ -1,35 +0,0 @@
import * as core from '../utils/aniwatchCore';
import * as helper from '../utils/helpers';
export function init() {
core.registerScript(node => {
// run the scripts
if (helper.isHtmlElement(node)) {
addListHorizontalSeparators(node)
}
}, ".*");
}
function addListHorizontalSeparators(node) {
const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case
let updateFunc = item => {
// add border as horizontal seperator
item.style.borderBottom = "1px solid rgba(155,155,155, 0.2)";
}
// are we target tag?
if (node.tagName === targetTagName) {
if (typeof node.nextSibling !== "undefined") {
updateFunc(node);
}
} else {
// find items -> all
let requestItems = node.querySelectorAll('md-list-item:not(:last-child)');
// update borders
requestItems.forEach(item => {
updateFunc(item);
});
}
}

View file

@ -5,7 +5,6 @@ import { initHelpers } from './utils/helpers';
// enhancements
import { init as animeRequests } from './enhancements/animeRequests';
import { init as languageDisplay } from './enhancements/languageDisplay';
import { init as lists } from './enhancements/lists';
import { init as quickSearch } from './enhancements/quickSearch';
// core
@ -17,5 +16,4 @@ initHelpers();
// enhancements
animeRequests();
languageDisplay();
lists();
quickSearch();