Skip to content

Commit

Permalink
netteForms: added Nette.showModal() method
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 25, 2021
1 parent 7f1b03d commit 5ba98cc
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/assets/netteForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,24 @@
}

if (messages.length) {
alert(messages.join('\n'));

if (focusElem) {
focusElem.focus();
}
Nette.showModal(messages.join('\n'), function () {
if (focusElem) {
focusElem.focus();
}
});
}
};


/**
* Display modal window.
*/
Nette.showModal = function(message, onclose) {
alert(message);
onclose();
};


/**
* Validates single rule.
*/
Expand Down

0 comments on commit 5ba98cc

Please sign in to comment.