summaryrefslogtreecommitdiff
path: root/js/ajax.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/ajax.js')
-rw-r--r--js/ajax.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/ajax.js b/js/ajax.js
index 276e1ac7..8f0f7258 100644
--- a/js/ajax.js
+++ b/js/ajax.js
@@ -29,7 +29,14 @@ $(window).ready(function() {
formData.append('post', submit_txt);
var updateProgress = function(e) {
- $(form).find('input[type="submit"]').val(_('Posting... (#%)').replace('#', Math.round(e.position / e.total * 100)));
+ var percentage;
+ if (e.position === undefined) { // Firefox
+ percentage = Math.round(e.loaded * 100 / e.total);
+ }
+ else { // Chrome?
+ percentage = Math.round(e.position * 100 / e.total);
+ }
+ $(form).find('input[type="submit"]').val(_('Posting... (#%)').replace('#', percentage));
};
$.ajax({