From c2e735002d669a3385af4a9dfe4d10527f22af56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20=C5=A0er=C3=BD?= Date: Wed, 4 Sep 2024 17:01:44 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Oprava=20inicializace=20formul=C3=A1=C5=99?= =?UTF-8?q?=C5=AF.=20P=C5=AFvodn=C3=AD=20metodu=20`Nette.initForm`=20chcem?= =?UTF-8?q?e=20volat=20v=C5=BEdy.=20Sama=20o=20sob=C4=9B=20obsahuje=20kont?= =?UTF-8?q?rolu=20na=20op=C4=9Btovnou=20inicializaci,=20na=20za=C4=8D?= =?UTF-8?q?=C3=A1tku=20ale=20je=C5=A1t=C4=9B=20spou=C5=A1t=C3=AD=20nastave?= =?UTF-8?q?n=C3=AD,=20kter=C3=A9=20je=20nutn=C3=A9=20ud=C4=9Blat=20i=20po?= =?UTF-8?q?=20ajaxu=20(jmenovit=C4=9B=20inicializace=20toggle=20element?= =?UTF-8?q?=C5=AF).=20Metoda=20`Nette.toggleControl`=20je=20pak=20v=20Nett?= =?UTF-8?q?e=20o=C5=A1et=C5=99en=C3=A1=20proti=20v=C3=ADcen=C3=A1sobn?= =?UTF-8?q?=C3=A9mu=20nav=C3=A1z=C3=A1n=C3=AD=20handleru=20pomoc=C3=AD=20w?= =?UTF-8?q?eakMap.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/assets/pdForms.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5b1c0e7..93b4faf 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pd-forms", "title": "pdForms", "description": "Customization of netteForms for use in PeckaDesign.", - "version": "4.1.1", + "version": "4.1.2", "author": "PeckaDesign, s.r.o ", "contributors": [ "Radek Šerý ", diff --git a/src/assets/pdForms.js b/src/assets/pdForms.js index 75e1908..f51ffdc 100644 --- a/src/assets/pdForms.js +++ b/src/assets/pdForms.js @@ -1,7 +1,7 @@ /** * @name pdForms * @author Radek Šerý - * @version 4.1.1 + * @version 4.1.2 * * Features: * - live validation @@ -45,7 +45,7 @@ var pdForms = window.pdForms || {}; - pdForms.version = '4.1.1'; + pdForms.version = '4.1.2'; /** @@ -156,6 +156,7 @@ } } + validate.forEach(function(elem) { if (elem.getAttribute('data-pdforms-ever-focused')) { // assumes the input is valid, therefore removing all messages except those associated with ajax rules; this @@ -714,6 +715,9 @@ Nette.initForm = function (form) { // Skip already initialized forms if (form.noValidate) { + // Always call the original `initForm` method. This method handles already initialised forms itself. + pdForms.Nette.initForm(form); + return; } From ba9d41055d73c2cc3b4a94ec71e14ce08ca254cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20=C5=A0er=C3=BD?= Date: Wed, 4 Sep 2024 17:04:27 +0200 Subject: [PATCH 2/2] =?UTF-8?q?P=C5=99id=C3=A1n=C3=AD=20event=20parametru,?= =?UTF-8?q?=20kter=C3=BD=20je=20i=20v=20p=C5=AFvodn=C3=AD=20metod=C4=9B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/pdForms.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assets/pdForms.js b/src/assets/pdForms.js index f51ffdc..aff8829 100644 --- a/src/assets/pdForms.js +++ b/src/assets/pdForms.js @@ -712,16 +712,16 @@ /** * Setup handlers. */ - Nette.initForm = function (form) { + Nette.initForm = function (form, event) { // Skip already initialized forms if (form.noValidate) { // Always call the original `initForm` method. This method handles already initialised forms itself. - pdForms.Nette.initForm(form); + pdForms.Nette.initForm(form, event); return; } - pdForms.Nette.initForm(form); + pdForms.Nette.initForm(form, event); addDelegatedEventListener(form, 'focusout change', 'select, textarea, input:not([type="submit"]):not([type="reset"])', setEverFocused);