]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6961 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 29 Jul 2024 18:32:04 +0000 (20:32 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 29 Jul 2024 18:32:04 +0000 (20:32 +0200)
resources/linkeditor/js/linkeditor.js

index c52cdd431925fa0e68a72d3173679d18f25d1679..8cb41011282a5f74d2ac29971f0a8adf9ee7c188 100644 (file)
@@ -24,6 +24,7 @@ import LinkeditorLayers from "./linkeditor.layers";
 import LinkeditorUndo from './linkeditor.undo';
 import LinkeditorClipboard from './linkeditor.clipboard';
 import LinkeditorAccessControl from './linkeditor.accessControl';
+import FluidbookLinksAnimations from "./fluidbook.links.animations";
 
 window.$ = window.jQuery = require('jquery');
 window.key = require('keymaster-reloaded');
@@ -36,7 +37,7 @@ window.key.filter = function (event) {
 };
 
 function keyfilter(event, disable = false) {
-    if(disable) {
+    if (disable) {
         return false
     }
     let tagName = (event.target || event.srcElement).tagName;
@@ -120,6 +121,7 @@ LinkEditor.prototype = {
         this.undo = new LinkeditorUndo(this);
         this.accessControl = new LinkeditorAccessControl(this);
         this.previewLinks = new LinkeditorPreviewLinks(this);
+        this.linksAnimations = new FluidbookLinksAnimations(false);
 
         this.initEvents();
         this.initIcons();
@@ -202,7 +204,7 @@ LinkEditor.prototype = {
             } else if (e.keyCode == 18) {
                 $("#linkeditor-main").addClass('duplicate');
 
-            } else if (e.key == '>' || e.keyCode === 60 || e.keyCode === 226 || e.key==='<' || e.keyCode===188) {
+            } else if (e.key == '>' || e.keyCode === 60 || e.keyCode === 226 || e.key === '<' || e.keyCode === 188) {
                 $("#linkeditor-main").addClass('polygon');
             }
             $this.rulers.moveRuler();
@@ -216,7 +218,7 @@ LinkEditor.prototype = {
                 $this.zoom.resetZoomDrag();
             } else if (e.keyCode == 18) {
                 $("#linkeditor-main").removeClass('duplicate');
-            } else if (e.key == '>' || e.keyCode === 60 || e.keyCode === 226 || e.key==='<' || e.keyCode===188) {
+            } else if (e.key == '>' || e.keyCode === 60 || e.keyCode === 226 || e.key === '<' || e.keyCode === 188) {
                 $("#linkeditor-main").removeClass('polygon');
                 $this.links.closePolygonShape();
             }
@@ -377,8 +379,8 @@ LinkEditor.prototype = {
                     let v = parseFloat($(e).attr('fb-' + dim));
                     if (dim === 'width' || dim === 'height') {
                         css[dim] = (v * ($this.fs * $this.zoom.zoom)) + 1;
-                        if(dim === 'height') {
-                            if(LINKS[$(e).attr('fb-uid')].type === '35') {
+                        if (dim === 'height') {
+                            if (LINKS[$(e).attr('fb-uid')].type === '35') {
                                 $this.links.setFontSize(LINKS[$(e).attr('fb-uid')])
                             }
                         }
@@ -494,7 +496,7 @@ LinkEditor.prototype = {
         }
         this.undo.updateIconsStates();
         this.loader.preloadPages();
-        if($("#preview-links").hasClass("active")) {
+        if ($("#preview-links").hasClass("active")) {
             this.links.setPreview()
         }
     },