From: soufiane Date: Tue, 12 Dec 2023 13:27:38 +0000 (+0100) Subject: wip #6482 @0:30 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8dbf02f8e8932026f28471696deadfb38fb8ce67;p=fluidbook-toolbox.git wip #6482 @0:30 --- diff --git a/resources/linkeditor/js/linkeditor.js b/resources/linkeditor/js/linkeditor.js index bfad4fd01..e053120f7 100644 --- a/resources/linkeditor/js/linkeditor.js +++ b/resources/linkeditor/js/linkeditor.js @@ -568,12 +568,6 @@ LinkEditor.prototype = { getCurrentPage: function () { return this.currentPage; }, - - disableKeyboard: function (disable) { - $(document).keydown(function(e) { - e.preventDefault() - }) - } } @@ -609,12 +603,12 @@ $(function () { keyfilter(false,true) } } else { - $("#popup-overlay").removeClass("show") - window.linkeditor.popup.close('unavailable'); - window.linkeditor.disableKeyboard(false) + if ($("#popup-overlay").find('.popup[data-popup="unavailable"]').length > 0) { + $("#popup-overlay").removeClass("show") + window.linkeditor.popup.close(); + } window.key.filter = function (event) { let tagName = (event.target || event.srcElement).tagName; - //let field=tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'; if (tagName === 'TEXTAREA' && event.keyCode === 13) { return false; } diff --git a/resources/linkeditor/js/linkeditor.popup.js b/resources/linkeditor/js/linkeditor.popup.js index 923c48ef5..58d0a262d 100644 --- a/resources/linkeditor/js/linkeditor.popup.js +++ b/resources/linkeditor/js/linkeditor.popup.js @@ -24,7 +24,7 @@ LinkeditorPopup.prototype = { this.resize(); }, - close: function () { + close: function (name = '') { $("#popup-overlay").removeClass('show'); $("#popup-holder").html(''); },