Commit d0f72060 by Julian Arni

Review fixes

parent 07014e8e
...@@ -35,7 +35,7 @@ def upload_file(_step, file_name): ...@@ -35,7 +35,7 @@ def upload_file(_step, file_name):
def upload_file(_step, files_string): def upload_file(_step, files_string):
# Turn files_string to a list of file names # Turn files_string to a list of file names
files = files_string.split(",") files = files_string.split(",")
files = map(lambda x: string.strip(x, ' "'), files) files = map(lambda x: string.strip(x, ' "\''), files)
upload_css = 'a.upload-button' upload_css = 'a.upload-button'
world.css_click(upload_css) world.css_click(upload_css)
......
...@@ -53,7 +53,6 @@ function removeAsset(e){ ...@@ -53,7 +53,6 @@ function removeAsset(e){
function showUploadModal(e) { function showUploadModal(e) {
e.preventDefault(); e.preventDefault();
resetUploadModal(); resetUploadModal();
resetUploadBar();
$modal = $('.upload-modal').show(); $modal = $('.upload-modal').show();
$('.upload-modal .file-chooser').fileupload({ $('.upload-modal .file-chooser').fileupload({
dataType: 'json', dataType: 'json',
...@@ -61,10 +60,10 @@ function showUploadModal(e) { ...@@ -61,10 +60,10 @@ function showUploadModal(e) {
maxChunkSize: 100 * 1000 * 1000, // 100 MB maxChunkSize: 100 * 1000 * 1000, // 100 MB
autoUpload: true, autoUpload: true,
progressall: function(e, data) { progressall: function(e, data) {
var percentComplete = parseInt(data.loaded / data.total * 100, 10); var percentComplete = parseInt((100 * data.loaded) / data.total, 10);
showUploadFeedback(e, percentComplete); showUploadFeedback(e, percentComplete);
}, },
maxFileSize: 10 * 1000 * 1000, // 100 MB maxFileSize: 100 * 1000 * 1000, // 100 MB
maxNumberofFiles: 100, maxNumberofFiles: 100,
add: function(e, data) { add: function(e, data) {
data.process().done(function () { data.process().done(function () {
...@@ -103,6 +102,8 @@ function resetUploadBar() { ...@@ -103,6 +102,8 @@ function resetUploadBar() {
} }
function resetUploadModal() { function resetUploadModal() {
// Reset modal so it no longer displays information about previously
// completed uploads.
resetUploadBar(); resetUploadBar();
$('.upload-modal .file-name').html(''); $('.upload-modal .file-name').html('');
$('.upload-modal h1').html(gettext('Upload New File')); $('.upload-modal h1').html(gettext('Upload New 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