🐛 Fix an incompatibility with prototype.js < 1.7.3.0

This commit is contained in:
Yohann bianchi 2018-09-11 10:38:01 +02:00
parent 4671f04aba
commit 842cec6dc8
1 changed files with 10 additions and 9 deletions

View File

@ -877,7 +877,8 @@ var tarteaucitron = {
allDivs = main.childNodes; allDivs = main.childNodes;
if (typeof Array.prototype.map === 'function') { if (typeof Array.prototype.map === 'function') {
Array.prototype.map.call(main.children, Object).sort(function (a, b) { var mainChildren = Array.from(main.children);
mainChildren.sort(function (a, b) {
if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
return 0; return 0;