summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/models/Package.js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/static/js/models/Package.js')
-rw-r--r--module/web/static/js/models/Package.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/module/web/static/js/models/Package.js b/module/web/static/js/models/Package.js
index 0b9efca10..1b050d735 100644
--- a/module/web/static/js/models/Package.js
+++ b/module/web/static/js/models/Package.js
@@ -32,6 +32,13 @@ define(['jquery', 'backbone', 'underscore', 'app', 'collections/FileList', 'requ
initialize: function() {
},
+ toJSON: function(options) {
+ var obj = Backbone.Model.prototype.toJSON.call(this, options);
+ obj.percent = Math.round(obj.stats.linksdone * 100 / obj.stats.linkstotal);
+
+ return obj;
+ },
+
// Changes url + method and delegates call to super class
fetch: function(options) {
options = App.apiRequest(