Skip to content

Commit

Permalink
Merge pull request #57 from peckadesign/initForm
Browse files Browse the repository at this point in the history
Oprava inicializace formulářů
  • Loading branch information
zipper authored Sep 5, 2024
2 parents 3d675c4 + ba9d410 commit db69596
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <support@peckadesign.cz>",
"contributors": [
"Radek Šerý <radek.sery@peckadesign.cz>",
Expand Down
12 changes: 8 additions & 4 deletions src/assets/pdForms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @name pdForms
* @author Radek Šerý <radek.sery@peckadesign.cz>
* @version 4.1.1
* @version 4.1.2
*
* Features:
* - live validation
Expand Down Expand Up @@ -45,7 +45,7 @@

var pdForms = window.pdForms || {};

pdForms.version = '4.1.1';
pdForms.version = '4.1.2';


/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -711,13 +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, 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);

Expand Down

0 comments on commit db69596

Please sign in to comment.