MediaWiki:Common.js: различия между версиями

мНет описания правки
мНет описания правки
Строка 402: Строка 402:


                 cells.forEach(function(cell, index) {
                 cells.forEach(function(cell, index) {
                     if (cell.hasAttribute('rowspan') && cell.getAttribute('rowspan') !== '1') return;
                     if (!cell.hasAttribute('rowspan') || cell.getAttribute('rowspan') === '1') {
                    cell.addEventListener('mouseover', function() {
                        cell.addEventListener('mouseover', function() {
                        cells.forEach(function(innerCell, innerIndex) {
                            cells.forEach(function(innerCell, innerIndex) {
                            if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                                if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                                innerCell.style.setProperty('background-color', brightenColor(originalStyles[innerIndex].backgroundColor), 'important');
                                    innerCell.style.setProperty('background-color', brightenColor(originalStyles[innerIndex].backgroundColor), 'important');
                                innerCell.style.setProperty('color', brightenColor(originalStyles[innerIndex].color), 'important');
                                    innerCell.style.setProperty('color', brightenColor(originalStyles[innerIndex].color), 'important');
                             }
                                }
                             });
                         });
                         });
                    });
                        cell.addEventListener('mouseout', function() {
                    cell.addEventListener('mouseout', function() {
                            cells.forEach(function(innerCell, innerIndex) {
                        cells.forEach(function(innerCell, innerIndex) {
                                if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                            if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                                    innerCell.style.setProperty('background-color', originalStyles[innerIndex].backgroundColor, 'important');
                                innerCell.style.setProperty('background-color', originalStyles[innerIndex].backgroundColor, 'important');
                                    innerCell.style.setProperty('color', originalStyles[innerIndex].color, 'important');
                                innerCell.style.setProperty('color', originalStyles[innerIndex].color, 'important');
                                }
                             }
                             });
                         });
                         });
                     });
                     }
                 });
                 });
             });
             });