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

мНет описания правки
мНет описания правки
Строка 421: Строка 421:
                 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') return;
                     // Добавляем обработчик события при наведении мыши
                     // Добавляем обработчик события при наведении мыши
                     cell.addEventListener('mouseover', function() {
                     cell.addEventListener('mouseover', function() {
Строка 427: Строка 426:
                             if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                             if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                                 // Увеличиваем яркость фона и текста ячейки при наведении
                                 // Увеличиваем яркость фона и текста ячейки при наведении
                                 innerCell.style.backgroundColor = brightenColor(originalStyles[innerIndex].backgroundColor);
                                 innerCell.style.setProperty('background-color', brightenColor(originalStyles[innerIndex].backgroundColor), 'important');
                                 innerCell.style.color = brightenColor(originalStyles[innerIndex].color);
                                 innerCell.style.setProperty('color', brightenColor(originalStyles[innerIndex].color), 'important');
                             }
                             }
                         });
                         });
                     });
                     });
                     // Добавляем обработчик события, когда мышь уходит с ячейки
                     // Добавляем обработчик события, когда мышь уходит с ячейки
                     cell.addEventListener('mouseout', function() {
                     cell.addEventListener('mouseout', function() {
Строка 438: Строка 436:
                             if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                             if (!innerCell.hasAttribute('rowspan') || innerCell.getAttribute('rowspan') === '1') {
                                 // Восстанавливаем оригинальные стили после наведения
                                 // Восстанавливаем оригинальные стили после наведения
                                 innerCell.style.backgroundColor = originalStyles[innerIndex].backgroundColor;
                                 innerCell.style.setProperty('background-color', originalStyles[innerIndex].backgroundColor, 'important');
                                 innerCell.style.color = originalStyles[innerIndex].color;
                                 innerCell.style.setProperty('color', originalStyles[innerIndex].color, 'important');
                             }
                             }
                         });
                         });