/** 
 * 
 */
var InputFile = {

    formatFileBtn: function(btn, fileName, options) {
        options = options || {
            modify: true
        };

        btn.find('.btn-text').text(fileName);

        if (options.modify) {
            btn.removeClass('btn-info');
            btn.addClass('btn-success')
        };
    },

    resetFileBtn: function(btn, text) {
        btn.find('.btn-text').text(text);
        btn.addClass('btn-info');
        btn.removeClass('btn-success');
    },

    uploadStarted: function(e, data) {
        var button = $(e.currentTarget).closest('span');
        var id = button.data('id');        

        var va = 0;

        $('#divProgess'+id).html('<div class="progress" style="margin-top: 5px; margin-bottom: 10px; max-height: 5px;"><div class="progress-bar progress-bar-striped bg-success" role="progressbar" style="width: '+va+'%" aria-valuenow="'+va+'" aria-valuemin="0" aria-valuemax="100"></div></div>');
        //NProgress.start();
    },

    uploadProgress: function(e, data) {
        var button = $(e.currentTarget).closest('span');
        var id = button.data('id'); 

        var va = (data.loaded / data.total) * 100;        

        $('#divProgess'+id).html('<div class="progress" style="margin-top: 5px; margin-bottom: 10px; max-height: 5px;"><div class="progress-bar progress-bar-striped bg-success" role="progressbar" style="width: '+va+'%" aria-valuenow="'+va+'" aria-valuemin="0" aria-valuemax="100"></div></div>');
        //NProgress.set(data.loaded / data.total);
    },

};