Sfoglia il codice sorgente

add ressourceId to the grid tr element

tripeur 4 anni fa
parent
commit
6a7755f4fb
3 ha cambiato i file con 6 aggiunte e 7 eliminazioni
  1. 3 3
      lib/Timeline.js
  2. 0 0
      lib/Timeline.js.map
  3. 3 4
      src/Timeline.ts

+ 3 - 3
lib/Timeline.js

@@ -710,8 +710,8 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
       </td>
     </tr>`;
     }
-    renderGridRow(columns, rowId = -1, height = 30) {
-        return lit_element_1.html `<tr row-id="${rowId}">
+    renderGridRow(columns, id = "", height = 30) {
+        return lit_element_1.html `<tr ressourceid="${id}">
       ${columns.map((d, i) => lit_element_1.html `<td
             style="height:${height}px;"
             class="jc-slot ${i % this.legendSpan === 0 ? "jc-major-slot" : ""}"
@@ -783,7 +783,7 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
 
             <tbody>
               ${this.rows.length > 0
-            ? displayedRows.map((o) => this.renderGridRow(columns, o.i, o.r.height))
+            ? displayedRows.map((o) => this.renderGridRow(columns, o.r.id, o.r.height))
             : this.renderGridRow(columns)}
             </tbody>
           </table>

File diff suppressed because it is too large
+ 0 - 0
lib/Timeline.js.map


+ 3 - 4
src/Timeline.ts

@@ -182,7 +182,6 @@ class Timeline extends LitElement {
    * @param ressource
    * @returns The Ressource object registered to in the timeline
    */
-  //TODO add posibbility to add resource at a given rows
   addRessource(ressource: IRessource, pos = 0): Ressource {
     const existingRessource = this.getRessourceFromId(ressource.id);
     if (existingRessource) {
@@ -844,8 +843,8 @@ class Timeline extends LitElement {
       </td>
     </tr>`;
   }
-  private renderGridRow(columns: Array<Dayjs>, rowId = -1, height = 30): TemplateResult {
-    return html`<tr row-id="${rowId}">
+  private renderGridRow(columns: Array<Dayjs>, id = "", height = 30): TemplateResult {
+    return html`<tr ressourceid="${id}">
       ${columns.map(
         (d, i) =>
           html`<td
@@ -923,7 +922,7 @@ class Timeline extends LitElement {
 
             <tbody>
               ${this.rows.length > 0
-                ? displayedRows.map((o) => this.renderGridRow(columns, o.i, o.r.height))
+                ? displayedRows.map((o) => this.renderGridRow(columns, o.r.id, o.r.height))
                 : this.renderGridRow(columns)}
             </tbody>
           </table>

Some files were not shown because too many files changed in this diff