Answer the question
In order to leave comments, you need to log in
Why Uncaught TypeError: Cannot read property 'Constructor' of undefined?
There is a modal on the page that opens a form with two textarea:
<div class="modal box-modal">
<form class="">
<div class="form_row">
<div class="input_cover">
<textarea class="ckeditor" rows="10" cols="80" name="editor1" id="editor1"></textarea>
</div>
</div>
<div class="form_row">
<div class="input_cover">
<textarea class="ckeditor" rows="10" cols="80" name="editor2" id="editor2"></textarea>
</div>
</div>
<button class="save">Сохранить</button>
</form>
</div>
<script>
$(document).ready(function () {
$.fn.modal.Constructor.prototype.enforceFocus = function () {
modal_this = this;
$(document).on('focusin.modal',
function(e) {
if (modal_this.$element[0] !== e.target &&
!modal_this.$element.has(e.target).length
// add whatever conditions you need here:
&&
!$(e.target.parentNode).hasClass('cke_dialog_ui_input_select') &&
!$(e.target.parentNode).hasClass('cke_dialog_ui_input_text')) {
modal_this.$element.focus();
}
});
};
});
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question