Merge pull request #69 from Serraniel/bugfix/#67-list-separator-on-last-element

Bugfix/#67 list separator on last element
This commit is contained in:
Daniel 2020-10-12 17:52:45 +02:00 committed by GitHub
commit 402a6b302d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 36 deletions

View file

@ -31,7 +31,7 @@ function changeBorderColorOwnRequests(node) {
// highlight left border for own request
if (profileLink.length > 0) {
item.style.borderColor = color.aniBlue
item.style.borderLeftColor = color.aniBlue
}
}

View file

@ -1,33 +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) {
updateFunc(node);
} else {
// find items -> all
let requestItems = node.querySelectorAll('md-list-item');
// 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();

View file

@ -21,6 +21,9 @@
"js": [
"javascript/app.min.js"
],
"css": [
"stylesheets/aniwatchplus.min.css"
],
"run_at": "document_end"
}]
}

View file

@ -21,6 +21,9 @@
"js": [
"javascript/app.min.js"
],
"css": [
"stylesheets/aniwatchplus.min.css"
],
"run_at": "document_end"
}]
}

View file

@ -25,6 +25,9 @@
"js": [
"javascript/app.min.js"
],
"css": [
"stylesheets/aniwatchplus.min.css"
],
"run_at": "document_end"
}]
}

View file

@ -22,6 +22,9 @@
"js": [
"javascript/app.min.js"
],
"css": [
"stylesheets/aniwatchplus.min.css"
],
"run_at": "document_end"
}]
}

View file

@ -0,0 +1,5 @@
// vars
@import './vars/colors';
// enhancements
@import './enhancements/lists.scss';

View file

@ -0,0 +1,5 @@
md-list-item {
&:not(:last-child) {
border-bottom: 1px solid $gray;
}
}

View file

@ -0,0 +1,2 @@
$aniwatchBlue: #348fff;
$gray: rgba(155, 155, 155, 0.2);