Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(el) {
this.el = el;
// validationでerrorとなったときのイベントハンドラ
Parsley.on('field:error', (fieldInstance) => {
if (isSP()) SPParseleyCallback.onError(fieldInstance);
else PCParsleyCallback.onError(fieldInstance);
});
// validationでsuccessとなったときのイベントハンドラ
Parsley.on('field:success', (fieldInstance) => {
if (isSP()) SPParseleyCallback.onSuccess(fieldInstance);
else PCParsleyCallback.onSuccess(fieldInstance);
});
// errorとなったときに付与するclass名を指定
Parsley.options.errorClass = ERROR_CLASS;
ParsleyWrapper.addCustomValidator();
ParsleyWrapper.changeErrorMessage();
}