#20 added function to add list seperators globally
This commit is contained in:
parent
526098fc0e
commit
502fa4d2dc
|
@ -1,4 +1,28 @@
|
|||
registerScript(node => {
|
||||
// run the scripts
|
||||
|
||||
if (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);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue