From 8dbf02f8e8932026f28471696deadfb38fb8ce67 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 12 Dec 2023 14:27:38 +0100 Subject: [PATCH] wip #6482 @0:30 --- resources/linkeditor/js/linkeditor.js | 14 ++++---------- resources/linkeditor/js/linkeditor.popup.js | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) 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(''); }, -- 2.39.5