Browse Source

Restore shadowroot

tripeur 4 years ago
parent
commit
888f6c4bd4
3 changed files with 7 additions and 8 deletions
  1. 4 5
      lib/Timeline.js
  2. 0 0
      lib/Timeline.js.map
  3. 3 3
      src/Timeline.ts

+ 4 - 5
lib/Timeline.js

@@ -324,7 +324,7 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
         }
     }
     _grabHeader(e) {
-        const root = this.renderRoot;
+        const root = this.shadowRoot;
         if (root !== null) {
             const gridContainer = root.querySelector(".jc-timeline-grid-container");
             const headerContainer = root.querySelector(".jc-timeline-grid-title-container");
@@ -400,9 +400,8 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
                 }).reduce((prev, curr) => prev || curr);
             } : (_e) => { return false; };
             const updateRessource = ressourceEditable ? (e) => {
-                var _a, _b;
-                const rowId = (_b = (_a = document.elementsFromPoint(e.clientX, e.clientY)
-                    .find((e) => e.tagName == "TD")) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getAttribute('row-id');
+                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;
                     if (ressourceId !== localSlot.ressourceId) {
@@ -481,7 +480,7 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
         };
     }
     firstUpdated() {
-        const root = this.renderRoot;
+        const root = this.shadowRoot;
         if (root !== null) {
             const gridContainer = root.querySelector(".jc-timeline-grid-container");
             const simplebar = new simplebar_1.default(gridContainer).getScrollElement();

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


+ 3 - 3
src/Timeline.ts

@@ -406,7 +406,7 @@ class Timeline extends LitElement {
         }
     }
     private _grabHeader(e: MouseEvent):void {
-        const root = this.renderRoot;
+        const root = this.shadowRoot;
         if (root !== null) {
             const gridContainer = root.querySelector(".jc-timeline-grid-container") as HTMLBaseElement;
             const headerContainer = root.querySelector(".jc-timeline-grid-title-container") as HTMLBaseElement;
@@ -488,7 +488,7 @@ class Timeline extends LitElement {
             } : (_e: MouseEvent) => { return false };
 
             const updateRessource = ressourceEditable ? (e: MouseEvent) => {
-                const rowId = document.elementsFromPoint(e.clientX, e.clientY)
+                const rowId = 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;
@@ -573,7 +573,7 @@ class Timeline extends LitElement {
         };
     }
     firstUpdated():void {
-        const root = this.renderRoot;
+        const root = this.shadowRoot;
         if (root !== null) {
             const gridContainer = root.querySelector(".jc-timeline-grid-container") as HTMLBaseElement;
             const simplebar = new SimpleBar(gridContainer).getScrollElement() as HTMLBaseElement;

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