From: Vincent Vanwaelscappel Date: Wed, 26 Apr 2023 11:50:32 +0000 (+0200) Subject: wip #5882 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=52c31ec2c558d5d5074dd3124eb42f2e4d70b4d5;p=fluidbook-toolbox.git wip #5882 @0:20 --- diff --git a/resources/linkeditor/js/linkeditor.form.js b/resources/linkeditor/js/linkeditor.form.js index e98a57cc5..0e237a179 100644 --- a/resources/linkeditor/js/linkeditor.form.js +++ b/resources/linkeditor/js/linkeditor.form.js @@ -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(); diff --git a/resources/linkeditor/js/linkeditor.js b/resources/linkeditor/js/linkeditor.js index fc70d7bb7..3a6b31eea 100644 --- a/resources/linkeditor/js/linkeditor.js +++ b/resources/linkeditor/js/linkeditor.js @@ -165,6 +165,7 @@ LinkEditor.prototype = { } } else if (e.keyCode == 18) { $("#linkeditor-main").addClass('duplicate'); + return false; } $this.rulers.moveRuler(); }); diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index 5efce8868..0f158b9e5 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -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(); } }, diff --git a/resources/linkeditor/js/linkeditor.undo.js b/resources/linkeditor/js/linkeditor.undo.js index f2f73ded9..0189f092a 100644 --- a/resources/linkeditor/js/linkeditor.undo.js +++ b/resources/linkeditor/js/linkeditor.undo.js @@ -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; }