Commit d35ff48e by Lyla Fischer Committed by Calen Pennington

fixed up some of the ajax feedback to display to the user

parent deca6e66
......@@ -234,25 +234,27 @@ function startUpload(e) {
$('.upload-modal h1').html('Uploading…');
$('.upload-modal .file-name').html($('.file-input').val());
var bar = $('.progress-fill');
var percent = $('.percent');
var bar = $('.upload-modal .progress-fill');
$('.upload-modal .file-chooser').ajaxSubmit({
beforeSend: function() {
var percentVal = '0%';
bar.width(percentVal)
percent.html(percentVal);
bar.html(percentVal);
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
bar.width(percentVal)
percent.html(percentVal);
bar.html(percentVal);
},
complete: function(xhr) {
markAsLoaded();
if(xhr.status = 200){
markAsLoaded();
}
bar.html(xhr.responseText);
$('.upload-modal .choose-file-button').html('Load Another File').show();
}
});
$('.upload-modal .choose-file-button').hide();
$('.upload-modal .progress-bar').removeClass('loaded').show();
}
......@@ -260,9 +262,7 @@ function startUpload(e) {
function markAsLoaded() {
$('.upload-modal .copy-button').css('display', 'inline-block');
$('.upload-modal .progress-bar').addClass('loaded');
$('.upload-modal .progress-fill').html('loaded successfully');
$('.upload-modal .choose-file-button').html('Load Another File').show();
}
}
function hideModal(e) {
e.preventDefault();
......
......@@ -188,9 +188,7 @@
<div class="progress-bar">
<div class="progress-fill"></div>
</div>
<div class="percent">0%</div>
<div class="status"></div>
<a href="#" class="copy-button">Copy Embed Link</a>
<a href="#" class="copy-button">Copy Embed Link</a>
<form class="file-chooser" action="${upload_asset_callback_url}" method="post" enctype="multipart/form-data">
<a href="#" class="choose-file-button">Choose File</a>
<input type="file" class="file-input" name="file">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment