Ignore:
Timestamp:
Apr 23, 2015 12:00:06 PM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/assets/js/collaborator/collaborator.js

    r883 r906  
     1(function($){
     2    $.fn.setCursorToTextEnd = function() {
     3        $initialVal = this.val();
     4        this.val($initialVal + ' ');
     5        this.val($initialVal);
     6    };
     7})(jQuery);
    18$(document).on('change', '.upload', function() {
    29                var path = this.value;
     
    2229                        cache: false,
    2330                        success: function(data){
     31                                console.log(data)
    2432                                $("#charging").css('display', 'none');
    2533                                $("#result").html(data);
    2634                        },
    2735                        error: function(data){
     36                                console.log(data);
    2837                        }
    2938                });
     
    3241       
    3342});
     43
     44function updateInfo() {
     45    $.ajax({
     46        url: '/collaborator/collaborator/updateCollaborator/',
     47        type: 'POST',
     48        data: $("#frm-update-info").serialize(),
     49        success: function (data, textStatus, jqXHR)
     50        {
     51            result = jQuery.parseJSON(data);
     52            if (result.success == "1")
     53            {
     54                                $("#updateInfoSuccess").modal('show');
     55                                $("#close").click(function(){
     56                                        window.location.reload(true);
     57                                });
     58               
     59            }
     60            else
     61            {
     62                                //console.log(result.errors);
     63                for (var key in result.errors)
     64                {
     65                                        console.log(result.errors[key]['field']);
     66                    $('#' + result.errors[key]['field']).html(result.errors[key]['content']);
     67                }
     68            }
     69        }
     70    });
     71}
    3472
    3573function changePassword(collaborator_id)
Note: See TracChangeset for help on using the changeset viewer.