Skip to content

Commit

Permalink
[FIX] Change spread operator to Array.from for Edge browser (#12818)
Browse files Browse the repository at this point in the history
* Change spread operator to Array.from for Edge browser- closes #12809

* fat finger fix

* Edge fix for spread operator additional files

* revert package-lock
  • Loading branch information
ohmonster authored and rodrigok committed Dec 4, 2018
1 parent 2f260fe commit 7ab1000
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/rocketchat-lazy-load/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ const isVisible = (el, instance) => {
window.addEventListener('resize', window.lazyloadtick);

export const lazyloadtick = _.debounce(() => {
[...document.querySelectorAll('.lazy-img[data-src]')].forEach((el) =>
const lazyImg = document.querySelectorAll('.lazy-img[data-src]');
Array.from(lazyImg).forEach((el) =>
isVisible(el, Blaze.getView(el)._templateInstance)
);
}, 300);
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/client/lib/roomExit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ this.roomExit = function() {
if (mainNode == null) {
return;
}
return [...mainNode.children].forEach((child) => {
return Array.from(mainNode.children).forEach((child) => {
if (child == null) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui/client/lib/sideNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ SideNav = new class { //eslint-disable-line
}
}
focusInput() {
const sideNavDivs = [...this.sideNav[0].children].filter((el) => el.tagName === 'DIV' && !el.classList.contains('hidden'));
const sideNavDivs = Array.from(this.sideNav[0].children).filter((el) => el.tagName === 'DIV' && !el.classList.contains('hidden'));
let highestZidx = 0;
let highestZidxElem;
sideNavDivs.forEach((el) => {
Expand Down

0 comments on commit 7ab1000

Please sign in to comment.