- Fecha y hora:
- 08/12/2016 17:14:04 (hace 7 años)
- Branches:
- master, carga
- Children:
- 2b509cc
- Parents:
- dc618c3
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
static/js/layouts.js
rd5fefdf re9477bd 1 1 $(document).ready(function() { 2 2 var select2 = $(".select2"), refresh_captcha = $('.js-captcha-refresh'), 3 input_captcha = $('input[name="captcha_1"]'), input_fecha = $(".fecha"); 3 input_captcha = $('input[name="captcha_1"]'), input_fecha = $(".fecha"), 4 file = $("#file"), form_upload = $('#form-upload-file'); 4 5 5 6 if (select2.length > 0) { … … 35 36 }); 36 37 } 38 39 if (file.length && form_upload.length) { 40 /** Accion a ejecutar al solicitar la descarga de archivos */ 41 $('.download-file').on('click', function(e) { 42 e.preventDefault(); 43 set_filters(); 44 }); 45 46 /** realiza la accion de hacer click en el campo de archivo para cargar un archivo */ 47 $('.upload-file').on('click', function(e) { 48 e.preventDefault(); 49 file.click(); 50 }); 51 52 /** Acciones a ejecutar al solicitar la carga de datos */ 53 file.on('change', function(e) { 54 e.preventDefault(); 55 form_upload.ajaxForm({ 56 beforeSubmit: function(arr, $form, options) { 57 set_filters(); 58 }, 59 type: 'post', 60 dataType: 'json', 61 success: function(response) { 62 if (response.result) { 63 bootbox.alert(response.message); 64 } 65 else { 66 bootbox.alert(response.message); 67 } 68 }, 69 error: function(jqxhr, textStatus, error) { 70 var err = textStatus + ", " + error; 71 bootbox.alert(MSG_PETICION_AJAX_FALLIDA + err); 72 console.log(MSG_PETICION_AJAX_FALLIDA + err); 73 } 74 }).submit(); 75 76 /** Previene el envio recurrente del formulario */ 77 form_upload.on('submit', function(e) { 78 e.preventDefault(); 79 }); 80 81 }); 82 } 37 83 });
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.