Procházet zdrojové kódy

fixed color for links in colored cells by adding a new variable that sets color: white when cell or row has background-color

Patrick O'Carroll před 7 roky
rodič
revize
7b5b94607b
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7 2
      public/app/plugins/panel/table/renderer.ts

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

@@ -214,15 +214,20 @@ export class TableRenderer {
     var style = '';
     var cellClasses = [];
     var cellClass = '';
+    var linkStyle = '';
+
+    if (this.colorState.row) {
+      linkStyle = ' style="color: white"';
+    }
 
     if (this.colorState.cell) {
       style = ' style="background-color:' + this.colorState.cell + ';color: white"';
+      linkStyle = ' style="color: white;"';
       this.colorState.cell = null;
     } else if (this.colorState.value) {
       style = ' style="color:' + this.colorState.value + '"';
       this.colorState.value = null;
     }
-
     // because of the fixed table headers css only solution
     // there is an issue if header cell is wider the cell
     // this hack adds header content to cell (not visible)
@@ -253,7 +258,7 @@ export class TableRenderer {
 
       cellClasses.push('table-panel-cell-link');
       columnHtml += `
-        <a href="${cellLink}" target="${cellTarget}" data-link-tooltip data-original-title="${cellLinkTooltip}" data-placement="right">
+        <a href="${cellLink}" target="${cellTarget}" data-link-tooltip data-original-title="${cellLinkTooltip}" data-placement="right" ${linkStyle}>
           ${value}
         </a>
       `;