From: Vincent Vanwaelscappel Date: Mon, 19 Jun 2023 16:41:45 +0000 (+0200) Subject: wait #6045 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=56c447c5a7131cd2a53ad2cd840f5477a1e1b5f5;p=fluidbook-toolbox.git wait #6045 @0:20 --- diff --git a/resources/linkeditor/js/linkeditor.layers.js b/resources/linkeditor/js/linkeditor.layers.js index a154ad415..07543d180 100644 --- a/resources/linkeditor/js/linkeditor.layers.js +++ b/resources/linkeditor/js/linkeditor.layers.js @@ -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();