diff --git a/public/templates/accountedit.tpl b/public/templates/accountedit.tpl index f1b7b7984b..2b327d8eab 100644 --- a/public/templates/accountedit.tpl +++ b/public/templates/accountedit.tpl @@ -50,6 +50,10 @@ +
+
+
+
@@ -141,6 +145,9 @@ $(document).ready(function() { $('#uploadForm').submit(function() { status('uploading the file ...'); + $('#upload-progress-bar').css('width', '0%'); + $('#upload-progress-box').show(); + if(!$('#userPhotoInput').val()) { error('select an image to upload!'); return false; @@ -151,6 +158,11 @@ $(document).ready(function() { error: function(xhr) { error('Error: ' + xhr.status); }, + + uploadProgress : function(event, position, total, percent) { + $('#upload-progress-bar').css('width', percent+'%'); + }, + success: function(response) { if(response.error) { @@ -182,6 +194,7 @@ $(document).ready(function() { $('#alert-status').hide(); $('#alert-success').hide(); $('#alert-error').hide(); + $('#upload-progress-box').hide(); } function status(message) { @@ -310,14 +323,15 @@ $(document).ready(function() { $('#change-picture-modal').modal('hide'); $('#upload-picture-modal').modal('show'); + hideAlerts(); - $('#pictureUploadSubmitBtn').on('click', function() { - $('#uploadForm').submit(); - }); - return false; }); + + $('#pictureUploadSubmitBtn').on('click', function() { + $('#uploadForm').submit(); + }); });