Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oprava inicializace formulářů #57

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>",
"contributors": [
"Radek Šerý <[email protected]>",
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ý <[email protected]>
* @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
Loading