]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5817 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 21 Mar 2023 15:58:36 +0000 (16:58 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 21 Mar 2023 15:58:36 +0000 (16:58 +0100)
resources/linkeditor/js/linkeditor.links.js

index 6b1f99cb2d594cb0dda0e0960c627a3548b22338..fa58c1dd41e1c82bf360cd78dd3429ed28014d42 100644 (file)
@@ -754,18 +754,22 @@ LinkeditorLinks.prototype = {
             if ($('#linkeditor-links [fb-uid="' + uid + '"]').length > 0) {
                 return;
             }
-            if (!$this.linkeditor.single && page % 2 === 1 && link.page % 2 === 0 && link.left > $this.linkeditor.pw) {
-                link.page++;
-                link.left -= $this.linkeditor.pw;
-            }
-            if (side === 'right') {
-                link.page--;
-                link.left = parseInt(link.left) + $this.linkeditor.pw;
+            link.left = parseFloat(link.left)
+            if (!$this.linkeditor.single) {
+                if (page % 2 === 1 && link.page % 2 === 0 && link.left > $this.linkeditor.pw) {
+                    link.page++;
+                    link.left -= $this.linkeditor.pw;
+                }
+                if (side === 'right' && link.page % 2 === 1) {
+                    link.page--;
+                    link.left += $this.linkeditor.pw;
+                }
             }
+
             if (link.page != page) {
                 return;
             }
-
+            console.log(link);
             $this.addLink(link, false);
         });
         this.updateLayers();