Преглед на файлове

add exclusion for unselection

tripeur преди 4 години
родител
ревизия
a4c4634f79
променени са 4 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. 3 0
      lib/Timeline.js
  2. 0 0
      lib/Timeline.js.map
  3. 1 1
      package.json
  4. 3 0
      src/Timeline.ts

+ 3 - 0
lib/Timeline.js

@@ -38,6 +38,9 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
             s: "s[s]",
         };
         this._clearSelectionHandler = (_e) => {
+            const exclusionZone = document.querySelectorAll("[jc-timeline-keep-select]");
+            if (Array.from(exclusionZone).some((e) => e.contains(_e.target)))
+                return;
             this.clearSelectedItems();
             const myEvent = new CustomEvent("item-selected", {
                 detail: { items: [] },

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
lib/Timeline.js.map


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jc-timeline",
-  "version": "0.2.3",
+  "version": "0.2.4",
   "description": "web component to manage ressources in time",
   "main": "./lib/main.js",
   "types": "./lib/main.d.ts",

+ 3 - 0
src/Timeline.ts

@@ -596,6 +596,9 @@ class Timeline extends LitElement {
     this.selectedList = [];
   }
   private _clearSelectionHandler = (_e: MouseEvent) => {
+    const exclusionZone = document.querySelectorAll("[jc-timeline-keep-select]");
+    if (Array.from(exclusionZone).some((e) => e.contains(_e.target as Node))) return;
+
     this.clearSelectedItems();
     const myEvent = new CustomEvent("item-selected", {
       detail: { items: [] },

Някои файлове не бяха показани, защото твърде много файлове са промени