Skip to content
Permalink
Browse files

netteForms: Nette.toggles changed to private formToggles

  • Loading branch information...
dg committed Sep 29, 2019
1 parent 2ca348a commit 37a9490a4f22ecbbf0b9aae4b54fb63f56481c94
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/assets/netteForms.js
@@ -29,6 +29,7 @@
'use strict';

var Nette = {};
var formToggles = {};

Nette.formErrors = [];
Nette.version = '3.0';
@@ -560,15 +561,15 @@
*/
Nette.toggleForm = function(form, elem) {
var i;
Nette.toggles = {};
formToggles = {};
for (i = 0; i < form.elements.length; i++) {
if (form.elements[i].tagName.toLowerCase() in {input: 1, select: 1, textarea: 1, button: 1}) {
Nette.toggleControl(form.elements[i], null, null, !elem);
}
}

for (i in Nette.toggles) {
Nette.toggle(i, Nette.toggles[i], elem);
for (i in formToggles) {
Nette.toggle(i, formToggles[i], elem);
}
};

@@ -627,7 +628,7 @@
}
for (var id2 in rule.toggle || []) {
if (Object.prototype.hasOwnProperty.call(rule.toggle, id2)) {
Nette.toggles[id2] = Nette.toggles[id2] || (rule.toggle[id2] ? curSuccess : !curSuccess);
formToggles[id2] = formToggles[id2] || (rule.toggle[id2] ? curSuccess : !curSuccess);
}
}
}

0 comments on commit 37a9490

Please sign in to comment.
You can’t perform that action at this time.