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:
commit
402a6b302d
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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();
|
|
@ -21,6 +21,9 @@
|
|||
"js": [
|
||||
"javascript/app.min.js"
|
||||
],
|
||||
"css": [
|
||||
"stylesheets/aniwatchplus.min.css"
|
||||
],
|
||||
"run_at": "document_end"
|
||||
}]
|
||||
}
|
|
@ -21,6 +21,9 @@
|
|||
"js": [
|
||||
"javascript/app.min.js"
|
||||
],
|
||||
"css": [
|
||||
"stylesheets/aniwatchplus.min.css"
|
||||
],
|
||||
"run_at": "document_end"
|
||||
}]
|
||||
}
|
|
@ -25,6 +25,9 @@
|
|||
"js": [
|
||||
"javascript/app.min.js"
|
||||
],
|
||||
"css": [
|
||||
"stylesheets/aniwatchplus.min.css"
|
||||
],
|
||||
"run_at": "document_end"
|
||||
}]
|
||||
}
|
|
@ -22,6 +22,9 @@
|
|||
"js": [
|
||||
"javascript/app.min.js"
|
||||
],
|
||||
"css": [
|
||||
"stylesheets/aniwatchplus.min.css"
|
||||
],
|
||||
"run_at": "document_end"
|
||||
}]
|
||||
}
|
5
src/stylesheets/aniwatchplus.scss
Normal file
5
src/stylesheets/aniwatchplus.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
// vars
|
||||
@import './vars/colors';
|
||||
|
||||
// enhancements
|
||||
@import './enhancements/lists.scss';
|
5
src/stylesheets/enhancements/_lists.scss
Normal file
5
src/stylesheets/enhancements/_lists.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
md-list-item {
|
||||
&:not(:last-child) {
|
||||
border-bottom: 1px solid $gray;
|
||||
}
|
||||
}
|
2
src/stylesheets/vars/_colors.scss
Normal file
2
src/stylesheets/vars/_colors.scss
Normal file
|
@ -0,0 +1,2 @@
|
|||
$aniwatchBlue: #348fff;
|
||||
$gray: rgba(155, 155, 155, 0.2);
|
Loading…
Reference in a new issue