Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 878 | Rev 880 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 878 Rev 879
Línea 426... Línea 426...
426
                if (result) {}
426
                if (result) {}
427
            }
427
            }
428
        });
428
        });
429
    });
429
    });
430
    /**
430
    /**
431
     * Validate rules form conduct
431
     * Clicked cancel new/edit Form
432
     */
432
     */
433
    var validatorFormConduct = $("#form-conduct").validate({
433
    $('button.btn-conduct-submit').click(function(e) {
434
        ignore: [],
-
 
435
        errorClass: 'help-block',
-
 
436
        errorElement: 'span',
-
 
437
        rules: {
-
 
-
 
434
        
438
            'conduct-description': {
435
        if($("#conduct-description").val()==""){
439
                required: false,
-
 
440
            },
-
 
441
            'conduct-level': {
-
 
442
                required: true,
-
 
443
            },
-
 
444
        },
-
 
445
        highlight: function(element) {
-
 
446
            $(element).closest('.form-group').addClass('has-error');
-
 
447
        },
-
 
448
        unhighlight: function(element) {
-
 
449
            $(element).closest('.form-group').removeClass('has-error');
-
 
450
        },
-
 
451
        errorPlacement: function(error, element) {
-
 
452
            if (element.attr("data-error-container")) {
-
 
453
                error.appendTo(element.attr("data-error-container"));
-
 
454
            } else {
-
 
455
                error.insertAfter(element);
436
            $.fn.showError('Ingrese una descripción');
456
            }
-
 
457
        },
-
 
458
        invalidHandler: function(form, validator) {
-
 
459
            if (!validator.numberOfInvalids())
-
 
460
                return;
-
 
461
            $('html, body').animate({
-
 
462
                scrollTop: $(validator.errorList[0].element).offset().top - 100
-
 
463
            }, 1000);
-
 
464
        },
-
 
465
        submitHandler: function(form) {
-
 
466
            var id = $('#form-conduct #conduct-id').val();
-
 
467
            if (id) {} else {}
-
 
468
            $('#modal-conduct').modal('hide');
-
 
469
            return false;
437
            return false;
-
 
438
 
-
 
439
        }else{
-
 
440
 
-
 
441
          $("#conduct-id").val()=="") ?
-
 
442
 
-
 
443
                addBehavior($("#conduct-description").val(), $("#conduct-level").val() :
-
 
444
                addBehavior($("#conduct-id").val(),$("#conduct-description").val(), $("#conduct-level").val())
-
 
445
        
470
        }
446
        }
471
    });
447
    });
472
    /**
448
    /**
473
     * Clicked cancel new/edit Form
449
     * Clicked cancel new/edit Form
474
     */
450
     */
Línea 692... Línea 668...
692
                     <option value="4">Cuatro</option>
668
                     <option value="4">Cuatro</option>
693
                  </select>
669
                  </select>
694
               </div>
670
               </div>
695
            </div>
671
            </div>
696
            <div class="modal-footer">
672
            <div class="modal-footer">
697
               <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
673
               <button type="button" class="btn btn-primary btn-conduct-submit">LABEL_SAVE</button>
698
               <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
674
               <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
699
            </div>
675
            </div>
700
         </div>
676
         </div>
701
      </form>
677
      </form>
702
   </div>
678
   </div>