mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-12 12:34:12 +01:00
N°2166: Fix regression introduced in b157fad
This commit is contained in:
@@ -2,18 +2,20 @@
|
||||
* Patches for bootstrap 3 as it is no longer maintained by its editor
|
||||
*/
|
||||
|
||||
//N°2166: Fix a boostrap/CKeditor incompatibility with their respective modals (source: https://stackoverflow.com/a/23667151)
|
||||
$.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
|
||||
// add whatever conditions you need here:
|
||||
&&
|
||||
!$parent.hasClass('cke_dialog_ui_input_select') && !$parent.hasClass('cke_dialog_ui_input_text')) {
|
||||
$modalElement.focus()
|
||||
}
|
||||
})
|
||||
//N°2166: Fix a boostrap/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 ) );
|
||||
};
|
||||
|
||||
// Hack to enable multiple modals by making sure the .modal-open class is set to the <body> when there is at least one modal open left
|
||||
|
||||
Reference in New Issue
Block a user