Blame view

backend/web/js/main.js 1.32 KB
c7f222e2   Artem   first
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  /**
   * Created by vitaliy on 22.01.15.
   */
  $(function () {
      
  
      $('.service-status').on('click', function(e){
          e.preventDefault();
          var status = $(this).data('status');
          if(status){
              this.removeAttribute("data-status");
              this.setAttribute("data-status","0");
              $(this).removeData();
              $(this).find('span').removeClass('glyphicon-remove');
              $(this).find('span').addClass('glyphicon-ok');
              var row = $(this).closest('tr');
              row.removeClass('active_');
              row.addClass('non_active');
              row.find('.status').val('0');
              row.find('.service-price').attr('disabled', 'disabled');
          } else {
              this.removeAttribute("data-status");
              this.setAttribute("data-status","1");
              $(this).removeData();
              $(this).find('span').removeClass('glyphicon-ok');
              $(this).find('span').addClass('glyphicon-remove');
              var row = $(this).closest('tr');
              row.removeClass('non_active');
              row.addClass('active_');
              row.find('.status').val('1');
              row.find('.service-price').removeAttr('disabled');
          }
      });
  
      $('body').on('click', '.delete-field-item', function(){
  
          $(this).parent('.form-group').remove();
  
      });
  
  
  });