Sfoglia il codice sorgente

fix change ressource handler

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

+ 2 - 3
lib/Timeline.js

@@ -472,9 +472,8 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
             const updateRessource = ressourceEditable
                 ? (e) => {
                     var _a, _b, _c;
-                    const rowId = (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.elementsFromPoint(e.clientX, e.clientY).find((e) => e.tagName == "TD")) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.getAttribute("row-id");
-                    if (rowId) {
-                        const ressourceId = this.rows[Number(rowId)].id;
+                    const ressourceId = (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.elementsFromPoint(e.clientX, e.clientY).find((e) => e.tagName == "TD")) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.getAttribute("ressourceid");
+                    if (ressourceId) {
                         if (ressourceId !== localSlot.ressourceId) {
                             const oldRessource = this.getRessourceFromId(localSlot.ressourceId);
                             localSlot.ressourceId = ressourceId;

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


+ 3 - 4
src/Timeline.ts

@@ -565,12 +565,11 @@ class Timeline extends LitElement {
 
       const updateRessource = ressourceEditable
         ? (e: MouseEvent) => {
-            const rowId = this.shadowRoot
+            const ressourceId = this.shadowRoot
               ?.elementsFromPoint(e.clientX, e.clientY)
               .find((e) => e.tagName == "TD")
-              ?.parentElement?.getAttribute("row-id");
-            if (rowId) {
-              const ressourceId = this.rows[Number(rowId)].id;
+              ?.parentElement?.getAttribute("ressourceid");
+            if (ressourceId) {
               if (ressourceId !== localSlot.ressourceId) {
                 const oldRessource = this.getRessourceFromId(localSlot.ressourceId) as Ressource;
                 localSlot.ressourceId = ressourceId;

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