Commit 519056da authored by Boris Kocherov's avatar Boris Kocherov

use notifyValid and notifyInvalid in checkValidity

parent eb3d81fc
...@@ -58,6 +58,12 @@ ...@@ -58,6 +58,12 @@
throw error; throw error;
}); });
}) })
.allowPublicAcquisition("notifyValid", function () {
return;
})
.allowPublicAcquisition("notifyInvalid", function () {
return;
})
.onEvent("submit", function () { .onEvent("submit", function () {
var g = this; var g = this;
return g.props.form_view.getContent() return g.props.form_view.getContent()
......
...@@ -1076,9 +1076,6 @@ ...@@ -1076,9 +1076,6 @@
g.props = {}; g.props = {};
g.options = {}; g.options = {};
}) })
.declareAcquiredMethod("notifyValid", "notifyValid")
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")
.declareAcquiredMethod("renameChildrenParent", "renameChildren") .declareAcquiredMethod("renameChildrenParent", "renameChildren")
.allowPublicAcquisition("renameChildren", function (opt_arr, scope) { .allowPublicAcquisition("renameChildren", function (opt_arr, scope) {
var property_name, var property_name,
...@@ -1210,6 +1207,8 @@ ...@@ -1210,6 +1207,8 @@
); );
}); });
}) })
.declareAcquiredMethod("notifyValid", "notifyValid")
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")
.declareAcquiredMethod("checkValidityParent", "checkValidityTop") .declareAcquiredMethod("checkValidityParent", "checkValidityTop")
.allowPublicAcquisition("checkValidityTop", function (arr) { .allowPublicAcquisition("checkValidityTop", function (arr) {
return this.checkValidity(arr[0]); return this.checkValidity(arr[0]);
...@@ -1244,9 +1243,9 @@ ...@@ -1244,9 +1243,9 @@
div.setAttribute("class", ""); div.setAttribute("class", "");
}); });
if (validation.valid) { if (validation.valid) {
return RSVP.Queue() return g.notifyValid()
.push(function () { .push(function () {
return "VALID"; return false;
}); });
} }
function print_error(message) { function print_error(message) {
...@@ -1277,8 +1276,9 @@ ...@@ -1277,8 +1276,9 @@
.push(function () { .push(function () {
return RSVP.all(tasks); return RSVP.all(tasks);
}) })
.push(g.notifyInvalid.bind(g))
.push(function () { .push(function () {
return "ERROR"; return false;
}); });
}); });
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment