File tree 2 files changed +6
-3
lines changed 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
import $ from 'jquery' ;
2
2
import { GET } from '../modules/fetch.js' ;
3
- import { elementsCall , toggleElem } from '../utils/dom.js' ;
3
+ import { toggleElem } from '../utils/dom.js' ;
4
4
5
5
const { appSubUrl, notificationSettings, assetVersionEncoded} = window . config ;
6
6
let notificationSequenceNumber = 0 ;
@@ -179,7 +179,10 @@ async function updateNotificationCount() {
179
179
const data = await response . json ( ) ;
180
180
181
181
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
+ }
183
186
184
187
return `${ data . new } ` ;
185
188
} catch ( error ) {
Original file line number Diff line number Diff line change 1
1
import { debounce } from 'throttle-debounce' ;
2
2
3
- export function elementsCall ( el , func , ...args ) {
3
+ function elementsCall ( el , func , ...args ) {
4
4
if ( typeof el === 'string' || el instanceof String ) {
5
5
el = document . querySelectorAll ( el ) ;
6
6
}
You can’t perform that action at this time.
0 commit comments