Skip to content

Commit 892cdc7

Browse files
committed
Revert "Use elementsCall"
This reverts commit 99d4ea3.
1 parent 06129a3 commit 892cdc7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

web_src/js/features/notification.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import $ from 'jquery';
22
import {GET} from '../modules/fetch.js';
3-
import {elementsCall, toggleElem} from '../utils/dom.js';
3+
import {toggleElem} from '../utils/dom.js';
44

55
const {appSubUrl, notificationSettings, assetVersionEncoded} = window.config;
66
let notificationSequenceNumber = 0;
@@ -179,7 +179,10 @@ async function updateNotificationCount() {
179179
const data = await response.json();
180180

181181
toggleElem('.notification_count', data.new !== 0);
182-
elementsCall('.notification_count', (el) => el.textContent = `${data.new}`);
182+
183+
for (const el of document.getElementsByClassName('notification_count')) {
184+
el.textContent = `${data.new}`;
185+
}
183186

184187
return `${data.new}`;
185188
} catch (error) {

web_src/js/utils/dom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {debounce} from 'throttle-debounce';
22

3-
export function elementsCall(el, func, ...args) {
3+
function elementsCall(el, func, ...args) {
44
if (typeof el === 'string' || el instanceof String) {
55
el = document.querySelectorAll(el);
66
}

0 commit comments

Comments
 (0)