| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 'use strict'; |
||
| 12 | update: function ( validationState ) { |
||
| 13 | // @fixme look why the 2nd condition was added and fix it differently. |
||
| 14 | // @fixme Element values should come from the store, not from the elements themselves |
||
| 15 | if ( validationState.isValid === true && this.element.val() !== "" ) { |
||
| 16 | this.element.addClass( 'valid' ).removeClass( 'invalid' ) |
||
| 17 | .next( 'span' ).addClass( 'icon-ok' ).removeClass( 'icon-bug icon-placeholder' ); |
||
| 18 | this.element.parent().addClass('valid').removeClass('invalid'); |
||
| 19 | } else if ( validationState.isValid === false ) { |
||
| 20 | this.element.addClass( 'invalid' ).removeClass( 'valid' ) |
||
| 21 | .next( 'span' ).addClass( 'icon-bug' ).removeClass( 'icon-ok icon-placeholder' ); |
||
| 22 | this.element.parent().addClass('invalid').removeClass('valid'); |
||
| 23 | } else if ( validationState.isValid === null ) { |
||
| 24 | this.element.removeClass( 'valid invalid' ) |
||
| 25 | .next( 'span' ).addClass( 'icon-placeholder' ).removeClass( 'icon-ok icon-bug' ); |
||
| 26 | this.element.parent().removeClass('invalid valid'); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | }; |
||
| 42 |