|
|
@@ -2,7 +2,7 @@
|
|
|
* BootstrapValidator (http://bootstrapvalidator.com)
|
|
|
* The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
|
|
|
*
|
|
|
- * @version v0.5.2-dev, built on 2014-08-24 3:49:20 PM
|
|
|
+ * @version v0.5.2-dev, built on 2014-08-24 4:09:31 PM
|
|
|
* @author https://twitter.com/nghuuphuoc
|
|
|
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
|
|
|
* @license MIT
|
|
|
@@ -277,7 +277,7 @@
|
|
|
group = this.options.fields[field].group || this.options.group,
|
|
|
$parent = $field.parents(group),
|
|
|
// Allow user to indicate where the error messages are shown
|
|
|
- container = this.options.fields[field].container || this.options.container,
|
|
|
+ container = ('function' === typeof (this.options.fields[field].container || this.options.container)) ? (this.options.fields[field].container || this.options.container).call(this, $field, this) : (this.options.fields[field].container || this.options.container),
|
|
|
$message = (container && container !== 'tooltip' && container !== 'popover') ? $(container) : this._getMessageContainer($field, group);
|
|
|
|
|
|
if (container && container !== 'tooltip' && container !== 'popover') {
|
|
|
@@ -888,7 +888,7 @@
|
|
|
$allErrors = $message.find('.help-block[data-bv-validator][data-bv-for="' + field + '"]'),
|
|
|
$errors = validatorName ? $allErrors.filter('[data-bv-validator="' + validatorName + '"]') : $allErrors,
|
|
|
$icon = $parent.find('.form-control-feedback[data-bv-icon-for="' + field + '"]'),
|
|
|
- container = this.options.fields[field].container || this.options.container,
|
|
|
+ container = ('function' === typeof (this.options.fields[field].container || this.options.container)) ? (this.options.fields[field].container || this.options.container).call(this, $field, this) : (this.options.fields[field].container || this.options.container),
|
|
|
isValidField = null;
|
|
|
|
|
|
// Update status
|
|
|
@@ -1519,10 +1519,9 @@
|
|
|
* It will remove all error messages, feedback icons and turn off the events
|
|
|
*/
|
|
|
destroy: function() {
|
|
|
- var field, fields, $field, validator, $icon, container, group;
|
|
|
+ var field, fields, $field, validator, $icon, group;
|
|
|
for (field in this.options.fields) {
|
|
|
fields = this.getFieldElements(field);
|
|
|
- container = this.options.fields[field].container || this.options.container,
|
|
|
group = this.options.fields[field].group || this.options.group;
|
|
|
for (var i = 0; i < fields.length; i++) {
|
|
|
$field = fields.eq(i);
|
|
|
@@ -1543,6 +1542,7 @@
|
|
|
// Remove feedback icons, tooltip/popover container
|
|
|
$icon = $field.parents(group).find('i[data-bv-icon-for="' + field + '"]');
|
|
|
if ($icon) {
|
|
|
+ var container = ('function' === typeof (this.options.fields[field].container || this.options.container)) ? (this.options.fields[field].container || this.options.container).call(this, $field, this) : (this.options.fields[field].container || this.options.container);
|
|
|
switch (container) {
|
|
|
case 'tooltip':
|
|
|
$icon.tooltip('destroy').remove();
|