#67 Removed obsolete list.js
This commit is contained in:
parent
0e39a6fbcc
commit
62fa39c2bf
|
@ -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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,7 +5,6 @@ import { initHelpers } from './utils/helpers';
|
||||||
// enhancements
|
// enhancements
|
||||||
import { init as animeRequests } from './enhancements/animeRequests';
|
import { init as animeRequests } from './enhancements/animeRequests';
|
||||||
import { init as languageDisplay } from './enhancements/languageDisplay';
|
import { init as languageDisplay } from './enhancements/languageDisplay';
|
||||||
import { init as lists } from './enhancements/lists';
|
|
||||||
import { init as quickSearch } from './enhancements/quickSearch';
|
import { init as quickSearch } from './enhancements/quickSearch';
|
||||||
|
|
||||||
// core
|
// core
|
||||||
|
@ -17,5 +16,4 @@ initHelpers();
|
||||||
// enhancements
|
// enhancements
|
||||||
animeRequests();
|
animeRequests();
|
||||||
languageDisplay();
|
languageDisplay();
|
||||||
lists();
|
|
||||||
quickSearch();
|
quickSearch();
|
Loading…
Reference in a new issue