Skip to content
Snippets Groups Projects

Refactor inbox_block_script library.

Files
3
@@ -84,11 +84,10 @@
* HTML content of threads.
*/
insertPreviousThreads(threadsHtml) {
const newNodes =
Drupal.PrivateMessageUtils.parseHTML(threadsHtml).childNodes;
const newNodes = Drupal.PrivateMessageUtils.parseHTML(threadsHtml);
newNodes.forEach((node) => {
const appendedElement = this.container.appendChild(node.cloneNode(true));
Array.from(newNodes).forEach((node) => {
const appendedElement = this.container.appendChild(node);
Drupal.attachBehaviors(appendedElement);
Drupal.PrivateMessageSlide.toggleSlide(appendedElement, true);
@@ -152,8 +151,8 @@
}
const newThreadContent = Drupal.PrivateMessageUtils.parseHTML(
newThreads[threadId],
).childNodes;
newThreadContent.forEach((child) => {
);
Array.from(newThreadContent).forEach((child) => {
const appendedElement = this.container.appendChild(child);
Drupal.attachBehaviors(appendedElement);
});
Loading