Advertisement
Guest User

Material Admin float not updating after change fix 2

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*------------------------------------------------
  2.     Form group blue line
  3. -------------------------------------------------*/
  4. if($('.form-group--float')[0]) {
  5.     $('.form-group--float').each(function () {
  6.         var c = $(this).find('.form-control')
  7.         var p = c.val()
  8.  
  9.         if(!p.length == 0) {
  10.             c.addClass('form-control--active');
  11.         }
  12.  
  13.         c.change(function () {
  14.             var x = $(this).val();
  15.  
  16.             if(!x.length == 0) {
  17.                 $(this).addClass('form-control--active');
  18.             }
  19.         });
  20.     });
  21.  
  22.     $('body').on('blur', '.form-group--float .form-control', function(){
  23.         var i = $(this).val();
  24.  
  25.         if (i.length == 0) {
  26.             $(this).removeClass('form-control--active');
  27.         }
  28.         else {
  29.             $(this).addClass('form-control--active');
  30.         }
  31.     });
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement