@@ -523,8 +523,7 @@ formsAngular
523
523
element . replaceWith ( $compile ( elementHtml ) ( scope ) ) ;
524
524
// If there are subkeys we need to fix up ng-model references when record is read
525
525
// If we have modelControllers we need to let them know when we have form + data
526
- // If BS3 we need to set up validation styling watch
527
- if ( subkeys . length > 0 || $data . modelControllers . length > 0 || cssFrameworkService . framework ( ) === 'bs3' ) {
526
+ if ( subkeys . length > 0 || $data . modelControllers . length > 0 ) {
528
527
var unwatch2 = scope . $watch ( 'phase' , function ( newValue ) {
529
528
if ( newValue === 'ready' ) {
530
529
unwatch2 ( ) ;
@@ -590,27 +589,6 @@ formsAngular
590
589
scope [ '$_arrayOffset_' + info . name . replace ( / \. / g, '_' ) + '_' + thisOffset ] = arrayOffset ;
591
590
}
592
591
}
593
-
594
- // If BS3, set up a watch on the record, so we can set has-error class etc
595
- if ( cssFrameworkService . framework ( ) === 'bs3' ) {
596
-
597
- // create the function that will do the checking / updating
598
- scope . bs3ValidationStyling = function ( ) {
599
- angular . forEach ( scope [ scope . topLevelFormName ] , function ( value , key ) {
600
- if ( typeof value === 'object' && value . hasOwnProperty ( '$modelValue' ) ) {
601
- var element = angular . element ( '#cg_' + key ) ;
602
- if ( value . $valid ) {
603
- element . removeClass ( 'has-error' ) ;
604
- } else {
605
- element . addClass ( 'has-error' ) ;
606
- }
607
- }
608
- } ) ;
609
- } ;
610
-
611
- scope . $watch ( recordAttribute , scope . bs3ValidationStyling , true ) ;
612
- scope . bs3ValidationStyling ( ) ; // Initialise the styling
613
- }
614
592
}
615
593
} ) ;
616
594
}
0 commit comments