diff --git a/typo3/sysext/backend/Resources/Private/TypeScript/FormEngineReview.ts b/typo3/sysext/backend/Resources/Private/TypeScript/FormEngineReview.ts index 2dfbe36dfdd68973a073a2f7697d6eeb1d5df8fe..284b4a68e9ea53210b5372791372c669792dd60d 100644 --- a/typo3/sysext/backend/Resources/Private/TypeScript/FormEngineReview.ts +++ b/typo3/sysext/backend/Resources/Private/TypeScript/FormEngineReview.ts @@ -133,9 +133,11 @@ class FormEngineReview { // Bootstrap has no official API to update the content of a popover w/o destroying it let $popover: any = $toggleButton.data('bs.popover'); - $popover.options.content = $list.wrapAll('<div>').parent().html(); - $popover.setContent(); - $popover.$tip.addClass($popover.options.placement); + if ($popover) { + $popover.options.content = $list.wrapAll('<div>').parent().html(); + $popover.setContent(); + $popover.$tip.addClass($popover.options.placement); + } } else { $toggleButton.addClass('hidden').popover('hide'); } diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineReview.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineReview.js index bc761295caf7975d190d9b6c5f2b68d1d6e52d45..8d7f6d36d2b536051ab2c50bf43afbad43454355 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineReview.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineReview.js @@ -48,9 +48,11 @@ define(["require", "exports", "TYPO3/CMS/Backend/FormEngineValidation", "jquery" $toggleButton.removeClass('hidden'); // Bootstrap has no official API to update the content of a popover w/o destroying it var $popover = $toggleButton.data('bs.popover'); - $popover.options.content = $list_1.wrapAll('<div>').parent().html(); - $popover.setContent(); - $popover.$tip.addClass($popover.options.placement); + if ($popover) { + $popover.options.content = $list_1.wrapAll('<div>').parent().html(); + $popover.setContent(); + $popover.$tip.addClass($popover.options.placement); + } } else { $toggleButton.addClass('hidden').popover('hide'); diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js index ff6497ff7b268577f0cebb07e36be0c233c25ab2..feba8af35288d755900ee3f71edc602e20042ac6 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js @@ -50,23 +50,16 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine', 'moment'], function ($, FormEn FormEngineValidation.initializeInputFields().promise().done(function () { // Bind to field changes $(document).on('change', FormEngineValidation.rulesSelector, function() { - // we need to wait, because the update of the select fields needs some time - window.setTimeout(function() { - FormEngineValidation.validate(); - }, 500); + FormEngineValidation.validate(); var $paletteField = $(this).closest('.t3js-formengine-palette-field'); $paletteField.addClass('has-change'); }); - // Bind to datepicker change event, but wait some milliseconds, because the init is not so fast - window.setTimeout(function() { - //noinspection JSUnusedLocalSymbols - $(document).on('dp.change', FormEngineValidation.dateTimeSelector, function(event) { - FormEngineValidation.validate(); - var $paletteField = $(this).closest('.t3js-formengine-palette-field'); - $paletteField.addClass('has-change'); - }); - }, 500); + $(document).on('dp.change', FormEngineValidation.dateTimeSelector, function(event) { + FormEngineValidation.validate(); + var $paletteField = $(this).closest('.t3js-formengine-palette-field'); + $paletteField.addClass('has-change'); + }); }); var today = new Date(); @@ -75,6 +68,7 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine', 'moment'], function ($, FormEn FormEngineValidation.lastTime = 0; FormEngineValidation.refDate = today; FormEngineValidation.USmode = 0; + FormEngineValidation.validate(); }; /** @@ -1041,13 +1035,7 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine', 'moment'], function ($, FormEn }; FormEngineValidation.registerReady = function() { - $(function() { - FormEngineValidation.initialize(); - // Start first validation after one second, because all fields are initial empty (typo3form.fieldSet) - window.setTimeout(function() { - FormEngineValidation.validate(); - }, 1000); - }); + FormEngineValidation.initialize(); }; FormEngine.Validation = FormEngineValidation;