]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5882 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 26 Apr 2023 11:50:32 +0000 (13:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 26 Apr 2023 11:50:32 +0000 (13:50 +0200)
resources/linkeditor/js/linkeditor.form.js
resources/linkeditor/js/linkeditor.js
resources/linkeditor/js/linkeditor.links.js
resources/linkeditor/js/linkeditor.undo.js

index e98a57cc598d768fc5ea990f48640153c27951e7..0e237a179892fa022c010331dbc67098b5b28ffc 100644 (file)
@@ -107,6 +107,7 @@ LinkeditorForm.prototype = {
         if (changed) {
             $(link).attr('fb-update', 1);
             this.linkeditor.links.updateLinkData($(link).attr('fb-origuid'), savedData);
+            this.linkeditor.links.setLastSelectedLink(link);
             this.linkeditor.hasChanged();
         }
         this.unmaskChangeEvent();
index fc70d7bb771b06f74b8a379faa7383d62d0709ae..3a6b31eeaf4f84ff60d7ececdac50ce4c072bf24 100644 (file)
@@ -165,6 +165,7 @@ LinkEditor.prototype = {
                 }
             } else if (e.keyCode == 18) {
                 $("#linkeditor-main").addClass('duplicate');
+                return false;
             }
             $this.rulers.moveRuler();
         });
index 5efce8868f514c5b4343966a7cf9a9f06f9cbfad..0f158b9e59348629006267431052be29fab6aa2c 100644 (file)
@@ -741,11 +741,16 @@ LinkeditorLinks.prototype = {
 
         this.linkeditor.form.updateLinkForm();
         if ($(l).is(':visible') && !$(l).is('.pendingCreate') && parseFloat($(l).attr('fb-width')) > 2 && parseFloat($(l).attr('fb-height')) > 2) {
-            this.lastSelectedLink = l;
+            this.setLastSelectedLink(l);
         }
         this.updateSelection();
     },
 
+    setLastSelectedLink: function (l) {
+        this.lastSelectedLink = l;
+        this.checkLastSelectedLink();
+    },
+
     checkLastSelectedLink: function () {
         if (this.lastSelectedLink === null || $(this.lastSelectedLink).length === 0) {
             return;
@@ -1062,15 +1067,14 @@ LinkeditorLinks.prototype = {
         if (dimension === 'both') {
             this.dimensionSelection('width', true);
             this.dimensionSelection('height', true);
-
         } else {
             let d = this.getMinMaxSelection(dimension);
             this.getCurrentSelection().each(function () {
                 $(this).attr('fb-' + dimension, d.maxl);
             });
         }
-        if (skipChanged !== true) {
-            this.updateSelectionData([dimension]);
+        if (skipChanged === undefined || skipChanged !== true) {
+            this.updateSelectionData(['width', 'height']);
             this.linkeditor.hasChanged();
         }
     },
index f2f73ded937e2da38cabfa97effb053165fd8cc7..0189f092a4b058729d7d5b90ec702db638fac1ab 100644 (file)
@@ -71,7 +71,7 @@ LinkeditorUndo.prototype = {
         let cs = this.linkeditor.links.getCurrentState();
         let ps = this.states[this.linkeditor.getCurrentPage()][index - 1];
         if (ps == cs) {
-            console.log('skipped : no change');
+            // console.log('skipped : no change');
             return;
         }