bind: function (type, doNotStore) {
var parsleyInstance;
switch (type) {
case 'parsleyForm':
parsleyInstance = $.extend(
new ParsleyForm(this.$element, this.domOptions, this.options),
new ParsleyAbstract(),
window.ParsleyExtend
)._bindFields();
break;
case 'parsleyField':
parsleyInstance = $.extend(
new ParsleyField(this.$element, this.domOptions, this.options, this.parent),
new ParsleyAbstract(),
window.ParsleyExtend
);
break;
case 'parsleyFieldMultiple':
parsleyInstance = $.extend(
new ParsleyField(this.$element, this.domOptions, this.options, this.parent),
new ParsleyMultiple(),
new ParsleyAbstract(),
window.ParsleyExtend
)._init();
break;
default:
throw new Error(type + 'is not a supported Parsley type');
}
if (this.options.multiple)
ParsleyUtils.setAttr(this.$element, this.options.namespace, 'multiple', this.options.multiple);
if ('undefined' !== typeof doNotStore) {
this.$element.data('ParsleyFieldMultiple', parsleyInstance);
return parsleyInstance;
}