Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15462 Rev 15464
Línea 1029... Línea 1029...
1029
 
1029
 
1030
       
1030
       
Línea -... Línea 1031...
-
 
1031
         $('#modal-status').modal('hide');
-
 
1032
    });
-
 
1033
 
-
 
1034
    $('body').on('click', 'button.btn-view-file', function(e) {
-
 
1035
        e.preventDefault();
-
 
1036
        var action   = $(this).data('href');
-
 
1037
 
-
 
1038
 
-
 
1039
        NProgress.start(); 
-
 
1040
        $.ajax({
-
 
1041
            'dataType'  : 'json',
-
 
1042
            'method'    : 'get',
-
 
1043
            'url'       :  action,
-
 
1044
        }).done(function(response) {
-
 
1045
            if(response['success']) {
-
 
1046
                var anchor = window.document.createElement("a");
-
 
1047
                anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['content'] ;
-
 
1048
                anchor.download = response['data']['basename'];
-
 
1049
                document.body.appendChild(anchor);
-
 
1050
                anchor.click();  // IE: "Access is denied"; see: https://connect.microsoft.com/IE/feedback/details/797361/ie-10-treats-blob-url-as-cross-origin-and-denies-access
-
 
1051
                document.body.removeChild(anchor);
-
 
1052
            } else {
-
 
1053
                $.fn.showError(response['data']);
-
 
1054
            }
-
 
1055
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
1056
            $.fn.showError(textStatus);
-
 
1057
        }).always(function() {
Línea 1031... Línea 1058...
1031
         $('#modal-status').modal('hide');
1058
            NProgress.done();
1032
    });
1059
        });
1033
 
1060
    });