From: Vincent Vanwaelscappel Date: Thu, 16 Mar 2023 16:26:09 +0000 (+0100) Subject: wip #5447 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0952864a915a3ed12b644dd082ee65ef2e286b08;p=fluidbook-toolbox.git wip #5447 @0.25 --- diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index 405f7f8df..5fbe87e3e 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -378,7 +378,7 @@ LinkeditorLinks.prototype = { } this.deselectAllLinks(); this.selectLink($(link)); - this.linkeditor.layers.updateSelection(); + this.updateSelection(); this.linkeditor.form.focusAndSelectDestinationField(); }, @@ -660,7 +660,7 @@ LinkeditorLinks.prototype = { this.linkeditor.form.updateLinkForm(); this.lastSelectedLink = l; - this.linkeditor.layers.updateSelection(); + this.updateSelection(); }, checkLastSelectedLink: function () { @@ -687,11 +687,12 @@ LinkeditorLinks.prototype = { this.linkeditor.form.saveFormDataInLink(); this.linkeditor.form.updateLinkForm(); $(".link.selected").removeClass('selected'); - this.linkeditor.layers.updateSelection(); + this.updateSelection(); }, deselectLink: function (link) { $(link).removeClass('selected'); + this.updateSelection(); }, offsetSelectedLinks: function (dim, value) { @@ -879,6 +880,7 @@ LinkeditorLinks.prototype = { this.linkeditor.hasChanged(); } this.updateLayers(); + this.updateSelection(); }, selectAll: function () { @@ -886,6 +888,11 @@ LinkeditorLinks.prototype = { $('.link').each(function () { $this.selectLink($(this)); }); + this.updateSelection(); + }, + + updateSelection: function () { + $("#linkeditor").attr('data-selection-count', this.getCurrentSelection().length); this.linkeditor.layers.updateSelection(); }, diff --git a/resources/linkeditor/style/inc/_toolbar.sass b/resources/linkeditor/style/inc/_toolbar.sass index a95799e34..6358431a5 100644 --- a/resources/linkeditor/style/inc/_toolbar.sass +++ b/resources/linkeditor/style/inc/_toolbar.sass @@ -28,6 +28,7 @@ div display: inline-block font-size: $font-size + vertical-align: top .separator width: 0 diff --git a/resources/linkeditor/style/style.sass b/resources/linkeditor/style/style.sass index 973e81439..59f1648f6 100644 --- a/resources/linkeditor/style/style.sass +++ b/resources/linkeditor/style/style.sass @@ -31,6 +31,17 @@ body, #linkeditor, html font-size: 0 overflow: hidden + .when-selection-2, .when-selection-3 + display: inline-block + + &[data-selection-count="0"], &[data-selection-count="1"] + .when-selection-2, .when-selection-3 + display: none + + &[data-selection-count="2"] + .when-selection-3 + display: none + .linkeditor-sidebar, #linkeditor-main display: inline-block height: 100% diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index 53f12d8fe..6ddba3402 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -219,9 +219,19 @@ diff --git a/resources/views/fluidbook_publication/link_editor_icons.blade.php b/resources/views/fluidbook_publication/link_editor_icons.blade.php index 5154aedf9..5a2111a18 100644 --- a/resources/views/fluidbook_publication/link_editor_icons.blade.php +++ b/resources/views/fluidbook_publication/link_editor_icons.blade.php @@ -1,5 +1,5 @@ {{-- __('!! Editeur de liens') --}} - + @push('linkeditor_scripts')