vendor/assets/javascripts/formvalidation/framework/pure.js in formvalidation-rails-0.7.1 vs vendor/assets/javascripts/formvalidation/framework/pure.js in formvalidation-rails-0.8.1
- old
+ new
@@ -1,14 +1,14 @@
-/*!
+/**
* FormValidation (http://formvalidation.io)
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
*
- * @version v0.7.1, built on 2016-02-01 12:00:57 AM
* @author https://twitter.com/formvalidation
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
* @license http://formvalidation.io/license/
*/
+
/**
* This class supports validating Pure framework (http://purecss.io/)
*/
(function($) {
FormValidation.Framework.Pure = function(element, options) {
@@ -51,14 +51,15 @@
*/
_fixIcon: function($field, $icon) {
var ns = this._namespace,
type = $field.attr('type'),
field = $field.attr('data-' + ns + '-field'),
- row = this.options.fields[field].row || this.options.row.selector,
- $parent = $field.closest(row);
+ $parent = $field.parent();
- if ($parent.find('label').length === 0) {
- $icon.addClass('fv-icon-no-label');
+ if ('checkbox' === type || 'radio' === type) {
+ if ($parent.is('label')) {
+ $icon.insertAfter($parent);
+ }
}
}
});
}(jQuery));