-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinject.js
More file actions
21 lines (17 loc) · 724 Bytes
/
Copy pathinject.js
File metadata and controls
21 lines (17 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
document.addEventListener('click', function () {
let commentHeader = document.getElementsByClassName("comment-widget__header");
Array.from(commentHeader).forEach(function (item, i, commentHeader) {
let parent = item.parentElement,
next = item.nextSibling,
button = document.createElement("button"),
text = document.createTextNode("test");
button.appendChild(text);
if (next) {
parent.insertBefore(button, next);
} else {
parent.appendChild(button);
}
});
});
// <button class="discussions__load-btn small white expand" data-ember-action="1607">Показать обсуждения (1)</button>