[Scummvm-git-logs] scummvm-web master -> 71001c9ad8cbecc9b1ea4a60cf01c7d88d50e1b4

Mataniko mataniko at gmail.com
Thu Jul 9 13:15:14 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
71001c9ad8 WEB: Only recolor the demo table that's being modified


Commit: 71001c9ad8cbecc9b1ea4a60cf01c7d88d50e1b4
    https://github.com/scummvm/scummvm-web/commit/71001c9ad8cbecc9b1ea4a60cf01c7d88d50e1b4
Author: mataniko (mataniko at gmail.com)
Date: 2020-07-09T09:14:59-04:00

Commit Message:
WEB: Only recolor the demo table that's being modified

Changed paths:
    public_html/js/game_demos.js


diff --git a/public_html/js/game_demos.js b/public_html/js/game_demos.js
index 1d6c9b8e..c83c85b8 100644
--- a/public_html/js/game_demos.js
+++ b/public_html/js/game_demos.js
@@ -12,12 +12,12 @@ function toggleCollapsibleRow(event) {
       next.classList.toggle("collapse");
       next = next.nextElementSibling;
     }
-    resetDemosTable();
+    recolorParentTable(clickedRow);
 }
 
 function initalizeTable() {
   var rows = document.querySelectorAll('.gameDemos tr');
-  for (let i = 0; i < rows.length-1; i++) {
+  for (var i = 0; i < rows.length-1; i++) {
     if (!rows[i].nextElementSibling) {
       continue;
     }
@@ -31,10 +31,10 @@ function initalizeTable() {
   }
 }
 
-function resetDemosTable() {
-  var rows = document.querySelectorAll('.gameDemos tr:not(.collapse)');
+function recolorParentTable(sourceRow) {
+  var rows = sourceRow.parentElement.querySelectorAll('tr:not(.collapse)');
 
-  for (let i = 0; i < rows.length; i++) {
+  for (var i = 0; i < rows.length; i++) {
     const row = rows[i];
     row.classList.remove("color2", "color0");
     i % 2 ? row.classList.add('color0') : row.classList.add('color2');




More information about the Scummvm-git-logs mailing list