MediaWiki:Common.js: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 402: | Строка 402: | ||
cells.forEach(function(cell, index) { | cells.forEach(function(cell, index) { | ||
var rowspan = parseInt(cell.getAttribute('rowspan'), 10); | |||
if (!isNaN(rowspan) && rowspan > 1) return; // Игнорируем ячейки с rowspan > 1 | |||
cell.addEventListener('mouseover', function() { | |||
cells.forEach(function(innerCell, innerIndex) { | |||
var innerRowspan = parseInt(innerCell.getAttribute('rowspan'), 10); | |||
if (!isNaN(innerRowspan) && innerRowspan > 1) return; // Игнорируем подсветку для ячеек с rowspan | |||
innerCell.style.setProperty('background-color', brightenColor(originalStyles[innerIndex].backgroundColor), 'important'); | |||
innerCell.style.setProperty('color', brightenColor(originalStyles[innerIndex].color), 'important'); | |||
}); | }); | ||
}); | |||
cell.addEventListener('mouseout', function() { | |||
cells.forEach(function(innerCell, innerIndex) { | |||
var innerRowspan = parseInt(innerCell.getAttribute('rowspan'), 10); | |||
if (!isNaN(innerRowspan) && innerRowspan > 1) return; // Игнорируем сброс стилей для ячеек с rowspan | |||
innerCell.style.setProperty('background-color', originalStyles[innerIndex].backgroundColor, 'important'); | |||
innerCell.style.setProperty('color', originalStyles[innerIndex].color, 'important'); | |||
}); | }); | ||
} | }); | ||
}); | }); | ||
}); | }); | ||