window.Parsley.UI = UI;
window.ParsleyUI = {
removeError: function (instance, name, doNotUpdateClass) {
var updateClass = true !== doNotUpdateClass;
Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);
return instance.removeError(name, {updateClass});
},
getErrorsMessages: function (instance) {
Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);
return instance.getErrorsMessages();
}
};
$.each('addError updateError'.split(' '), function (i, method) {
window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {
var updateClass = true !== doNotUpdateClass;
Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);
return instance[method](name, {message, assert, updateClass});
};
});