]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5895 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Apr 2023 09:24:01 +0000 (11:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Apr 2023 09:24:01 +0000 (11:24 +0200)
resources/linkeditor/js/linkeditor.js
resources/linkeditor/js/linkeditor.links.js
resources/linkeditor/js/linkeditor.toolbar.js
resources/linkeditor/js/linkeditor.utils.js
resources/views/fluidbook_publication/link_editor.blade.php

index f8bdcdcc15940438089915d5da0ebab186ba3861..8862b01dc66a34c390a45ac73037ff535fbfb11d 100644 (file)
@@ -523,6 +523,7 @@ LinkEditor.prototype = {
     getCurrentPage: function () {
         return this.currentPage;
     },
+
 }
 
 
index 1dbea0fc105fb96440063eca9e54ad863f2bb395..7c86b7bbe00bee1838c93664dad2192ef74b2a15 100644 (file)
@@ -445,9 +445,10 @@ LinkeditorLinks.prototype = {
         if (shortcut === 'pageup' || shortcut === 'pagedown' || shortcut === 'enter') {
             return true;
         }
-        return !$(document.activeElement).is('input,textarea,select');
+        return !this.linkeditor.utils.isfocusOnFormItem();
     },
 
+
     openImageLink: function () {
         let selection = $(".link[fb-type=6].selected");
         if (selection.length !== 1 || selection.attr('fb-alternative') == '') {
index c277ce06afeaeba4a12c8de84356507f29bf528c..c4e2b9bba315418e7570c84146d8f12873517762 100644 (file)
@@ -15,6 +15,9 @@ LinkeditorToolbar.prototype = {
         $("[data-key]").each(function () {
             let e = $(this);
             key($(this).data('key'), function () {
+                if ($(e).is('[data-key-skipintextfields]') && $this.linkeditor.utils.isfocusOnFormItem()) {
+                    return true;
+                }
                 $(e).addClass('hover');
                 $this.linkeditor.runAction($(e).data('action'));
                 setTimeout(function () {
index a111550b69d9af57d0dc62856823a9ba94db818b..26d265056dc46a405d831ece6ab1e5e3f204c0cb 100644 (file)
@@ -142,6 +142,9 @@ LinkeditorUtils.prototype = {
             r2.top > r1.bottom ||
             r2.bottom < r1.top);
     },
+    isfocusOnFormItem: function () {
+        return $(document.activeElement).is('input,textarea,select');
+    }
 };
 
 module.exports = LinkeditorUtils;
index a0160db0ac0fc4ea9c49ca4e35c5e08a6bd4afe0..bd6e465db5168a9b2c472d3a6189b7047bd85bb9 100644 (file)
                        data-key="ctrl+s"></a>
                     <a href="#" data-icon="undo" data-action="undo.undo"
                        data-tooltip="{{__('Annuler la dernière modification')}} (Ctrl+Z)"
-                       data-key="ctrl+z"></a>
+                       data-key="ctrl+z" data-key-skipintextfields></a>
                     <a href="#" data-icon="redo" data-action="undo.redo"
                        data-tooltip="{{__('Rétablir la derière modification')}} (Ctrl+Maj+Z)"
-                       data-key="ctrl+shift+z"></a>
+                       data-key="ctrl+shift+z" data-key-skipintextfields></a>
                     <div class="separator"></div>
                     <a href="#" data-action="zoom.reset" data-icon="zoom-reset"
                        data-tooltip="{{__('Réinitialiser le zoom')}} (Esc)" data-key="esc, ctrl+0, ctrl+numpad0"></a>