mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 15:34:12 +01:00
N°2166: Portal: fields in CKEditor modals are inactive
This commit is contained in:
@@ -94,6 +94,7 @@
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/d3.min.js'|add_itop_version }}"></script>
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/c3.min.js'|add_itop_version }}"></script>
|
||||
<script type="text/javascript" src="{{ app['combodo.portal.base.absolute_url'] ~ 'lib/bootstrap/js/bootstrap.min.js'|add_itop_version }}"></script>
|
||||
<script type="text/javascript" src="{{ app['combodo.portal.base.absolute_url'] ~ 'js/bootstrap-patches.js'|add_itop_version }}"></script>
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/latinise/latinise.min.js'|add_itop_version }}"></script>
|
||||
{# Visible.js to check if an element is visible on screen #}
|
||||
<script type="text/javascript" src="{{ app['combodo.portal.base.absolute_url'] ~ 'lib/jquery-visible/js/jquery.visible.min.js'|add_itop_version }}"></script>
|
||||
@@ -458,13 +459,6 @@
|
||||
$(this).removeData('bs.modal');
|
||||
$(this).find('.modal-content').html(GetContentLoaderTemplate());
|
||||
});
|
||||
// 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
|
||||
$('body').on('hidden.bs.modal', function () {
|
||||
if($('.modal.in').length > 0)
|
||||
{
|
||||
$('body').addClass('modal-open');
|
||||
}
|
||||
});
|
||||
// Hide tooltips when a modal is opening, otherwise it might be overlapping it
|
||||
$('body').on('show.bs.modal', function () {
|
||||
$(this).find('.tooltip.in').tooltip('hide');
|
||||
|
||||
26
datamodels/2.x/itop-portal-base/portal/web/js/bootstrap-patches.js
vendored
Normal file
26
datamodels/2.x/itop-portal-base/portal/web/js/bootstrap-patches.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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()
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// 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
|
||||
$(document).ready(function() {
|
||||
$('body').on('hidden.bs.modal', function () {
|
||||
if ($('.modal.in').length > 0) {
|
||||
$('body').addClass('modal-open');
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user