Browse Source

changed to use css classes instead of inline classes

David Crush 11 years ago
parent
commit
76e8927718
2 changed files with 12 additions and 5 deletions
  1. 9 0
      src/css/bootstrapValidator.css
  2. 3 5
      src/js/bootstrapValidator.js

+ 9 - 0
src/css/bootstrapValidator.css

@@ -19,3 +19,12 @@
 .nav-tabs li.bv-tab-error > a {
     color: #a94442;
 }
+
+.bv-form .bv-no-label {
+	top: 0px;
+}
+
+.bv-form .bv-input-group-icon {
+	top: 0px;
+	z-index: 100;
+}

+ 3 - 5
src/js/bootstrapValidator.js

@@ -306,14 +306,12 @@
                     // The feedback icon does not render correctly if there is no label
                     // https://github.com/twbs/bootstrap/issues/12873
                     if ($parent.find('label').length === 0) {
-                        $icon.css('top', 0);
+                        $icon.addClass('bv-no-label');
                     }
                     // Fix feedback icons in input-group
                     if ($parent.find('.input-group').length !== 0) {
-                        $icon.css({
-                            'top': 0,
-                            'z-index': 100
-                        }).insertAfter($parent.find('.input-group').eq(0));
+                        $icon.addClass('bv-input-group-icon')
+                        .insertAfter($parent.find('.input-group').eq(0));
                     }
                 }
             }