From 62fa39c2bf15125444945d0df6ab9af4294a196d Mon Sep 17 00:00:00 2001 From: Serraniel Date: Thu, 8 Oct 2020 21:05:12 +0200 Subject: [PATCH] #67 Removed obsolete list.js --- src/javascript/enhancements/lists.js | 35 ---------------------------- src/javascript/index.js | 2 -- 2 files changed, 37 deletions(-) delete mode 100644 src/javascript/enhancements/lists.js diff --git a/src/javascript/enhancements/lists.js b/src/javascript/enhancements/lists.js deleted file mode 100644 index e181770..0000000 --- a/src/javascript/enhancements/lists.js +++ /dev/null @@ -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); - }); - } -} \ No newline at end of file diff --git a/src/javascript/index.js b/src/javascript/index.js index fe14197..9d86b8a 100644 --- a/src/javascript/index.js +++ b/src/javascript/index.js @@ -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(); \ No newline at end of file