From 21513f8df05d2be7431a1f936760457700da6c35 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Fri, 12 Jul 2024 10:49:20 +0200 Subject: [PATCH 1/2] =?UTF-8?q?N=C2=B07552=20-=20Fix=20CKEditors=20table,?= =?UTF-8?q?=20hyperlinks,=20and=20other=20options=20inputs=20not=20working?= =?UTF-8?q?=20in=20iTop=20portal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portal/public/js/bootstrap-patches.js | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/datamodels/2.x/itop-portal-base/portal/public/js/bootstrap-patches.js b/datamodels/2.x/itop-portal-base/portal/public/js/bootstrap-patches.js index 2215c760bb..f4ae87988f 100644 --- a/datamodels/2.x/itop-portal-base/portal/public/js/bootstrap-patches.js +++ b/datamodels/2.x/itop-portal-base/portal/public/js/bootstrap-patches.js @@ -24,19 +24,16 @@ */ // N°2166: Fix a bootstrap/CKeditor incompatibility with their respective modals (source: https://stackoverflow.com/a/31679096) -$.fn.modal.Constructor.prototype.enforceFocus = function() { - $( document ) - .off( 'focusin.bs.modal' ) // guard against infinite focus loop - .on( 'focusin.bs.modal', $.proxy( function( e ) { - if ( - this.$element[ 0 ] !== e.target && !this.$element.has( e.target ).length - // CKEditor compatibility fix start. - && !$( e.target ).closest( '.cke_dialog, .cke' ).length - // CKEditor compatibility fix end. - ) { - this.$element.trigger( 'focus' ); - } - }, this ) ); +// N°7552 Update the ugly hacky hack to make it work with CKEditor 5. Only trigger the focus when the parent is not a CKEditor input (source: https://stackoverflow.com/questions/53556541/ckeditor-5-popup-controls-not-working-in-bootstrap-3-2018) +$.fn.modal.Constructor.prototype.enforceFocus = function () { + var $modalElement = this.$element; + $(document).on('focusin.modal', function (e) { + var $parent = $(e.target.parentNode); + if ($modalElement[0] !== e.target && !$modalElement.has(e.target).length && + !$parent.hasClass('ck-input')) { + e.target.focus() + } + }) }; // Hack to enable multiple modals by making sure the .modal-open class is set to the when there is at least one modal open left From f0c37bd69e8565f716caf69ed570de45d9a1fd37 Mon Sep 17 00:00:00 2001 From: Benjamin Dalsass <95754414+bdalsass@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:18:33 +0200 Subject: [PATCH 2/2] =?UTF-8?q?N=C2=B07630=20-=20Fix=20wrong=20enum/ext.?= =?UTF-8?q?=20key=20value=20selected=20when=20clicking=20on=20drop=20down?= =?UTF-8?q?=20list=20in=20modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/extkeywidget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/extkeywidget.js b/js/extkeywidget.js index e092101655..68e30ad300 100644 --- a/js/extkeywidget.js +++ b/js/extkeywidget.js @@ -169,7 +169,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper copyClassesToDropdown: false, inputClass: 'ibo-input ibo-input-select ibo-input-selectize', // To avoid dropdown to be cut by the container's overflow hidden rule - dropdownParent: 'body', + // dropdownParent: 'body', QUICKFIX!! N°7630 - Fix wrong enum/ext. key value selected when clicking on drop down list in modal onDropdownOpen: function (oDropdownElem) { me.UpdateDropdownPosition(this.$control, oDropdownElem); },