2020-08-04 12:35:14 +02:00
|
|
|
registerScript(node => {
|
|
|
|
// run the scripts
|
2020-08-04 14:39:58 +02:00
|
|
|
if (isHtmlElement(node)) {
|
|
|
|
addListHorizontalSeparators(node)
|
|
|
|
}
|
|
|
|
}, ".*");
|
2020-08-04 12:35:14 +02:00
|
|
|
|
2020-08-04 14:39:58 +02:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|