Explorar el Código

Fix bug with background color in table cell with link

Anton hace 7 años
padre
commit
6092fa4dc3
Se han modificado 1 ficheros con 7 adiciones y 6 borrados
  1. 7 6
      public/app/plugins/panel/table/renderer.ts

+ 7 - 6
public/app/plugins/panel/table/renderer.ts

@@ -211,16 +211,17 @@ export class TableRenderer {
     value = this.formatColumnValue(columnIndex, value);
     value = this.formatColumnValue(columnIndex, value);
 
 
     const column = this.table.columns[columnIndex];
     const column = this.table.columns[columnIndex];
-    let style = '';
+    let cellStyle = '';
+    let textStyle = '';
     const cellClasses = [];
     const cellClasses = [];
     let cellClass = '';
     let cellClass = '';
 
 
     if (this.colorState.cell) {
     if (this.colorState.cell) {
-      style = ' style="background-color:' + this.colorState.cell + '"';
+      cellStyle = ' style="background-color:' + this.colorState.cell + '"';
       cellClasses.push('table-panel-color-cell');
       cellClasses.push('table-panel-color-cell');
       this.colorState.cell = null;
       this.colorState.cell = null;
     } else if (this.colorState.value) {
     } else if (this.colorState.value) {
-      style = ' style="color:' + this.colorState.value + '"';
+      textStyle = ' style="color:' + this.colorState.value + '"';
       this.colorState.value = null;
       this.colorState.value = null;
     }
     }
     // because of the fixed table headers css only solution
     // because of the fixed table headers css only solution
@@ -232,7 +233,7 @@ export class TableRenderer {
     }
     }
 
 
     if (value === undefined) {
     if (value === undefined) {
-      style = ' style="display:none;"';
+      cellStyle = ' style="display:none;"';
       column.hidden = true;
       column.hidden = true;
     } else {
     } else {
       column.hidden = false;
       column.hidden = false;
@@ -258,7 +259,7 @@ export class TableRenderer {
       cellClasses.push('table-panel-cell-link');
       cellClasses.push('table-panel-cell-link');
 
 
       columnHtml += `
       columnHtml += `
-        <a href="${cellLink}" target="${cellTarget}" data-link-tooltip data-original-title="${cellLinkTooltip}" data-placement="right"${style}>
+        <a href="${cellLink}" target="${cellTarget}" data-link-tooltip data-original-title="${cellLinkTooltip}" data-placement="right"${textStyle}>
           ${value}
           ${value}
         </a>
         </a>
       `;
       `;
@@ -283,7 +284,7 @@ export class TableRenderer {
       cellClass = ' class="' + cellClasses.join(' ') + '"';
       cellClass = ' class="' + cellClasses.join(' ') + '"';
     }
     }
 
 
-    columnHtml = '<td' + cellClass + style + '>' + columnHtml + '</td>';
+    columnHtml = '<td' + cellClass + cellStyle + '>' + columnHtml + '</td>';
     return columnHtml;
     return columnHtml;
   }
   }