]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6045 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 19 Jun 2023 16:41:45 +0000 (18:41 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 19 Jun 2023 16:41:45 +0000 (18:41 +0200)
resources/linkeditor/js/linkeditor.layers.js

index a154ad41510150b48d298745ed7878f7b4b66dfb..07543d180eca19a06f5369eac7484a29f3f6b4f6 100644 (file)
@@ -9,22 +9,23 @@ LinkeditorLayers.prototype = {
         this.container = $("#linkeditor-panel-layers");
         this.maskCheckEvents = false;
 
-        $(document).on('change', "#linkeditor-panel-layers :checkbox", function () {
+        $(document).on('click', "#linkeditor-panel-layers label", function (e) {
             if ($this.maskCheckEvents) {
-                return;
+                return false;
             }
-            var link = $('#linkeditor-links [fb-uid="' + $(this).attr('name') + '"]');
-            if ($(this).prop('checked')) {
-                $this.linkeditor.links.selectLink(link);
-            } else {
-                $this.linkeditor.links.deselectLink(link);
+            let uid = $(this).find('input').attr('name');
+            var link = $('#linkeditor-links [fb-uid="' + uid + '"]');
+            if (!e.ctrlKey) {
+                $this.linkeditor.links.deselectAllLinks();
             }
+            $this.linkeditor.links.selectLink(link);
             $this.linkeditor.form.updateLinkForm();
+            return false;
         });
 
         $(document).on('click', '#linkeditor-panel-layers label span.uid', function () {
             navigator.clipboard.writeText($(this).attr('fb-uid'));
-            let tippy=$(this).data('tippyinstance');
+            let tippy = $(this).data('tippyinstance');
             console.log(tippy);
             tippy.setContent(TRANSLATIONS.id_copied);
             tippy.show();