summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/models/Package.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-20 17:05:30 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-20 17:05:30 +0100
commitd4fabd4878050fdfea4e88dfe54eb90b4e35690f (patch)
treec276e53d6272a2fc9de57d01b4b4b7b66891a66e /module/web/static/js/models/Package.js
parentmore animation for dashboard (diff)
downloadpyload-d4fabd4878050fdfea4e88dfe54eb90b4e35690f.tar.xz
tooltips and other improvements on webui
Diffstat (limited to 'module/web/static/js/models/Package.js')
-rw-r--r--module/web/static/js/models/Package.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/web/static/js/models/Package.js b/module/web/static/js/models/Package.js
index 24f04519e..c5eb3eaac 100644
--- a/module/web/static/js/models/Package.js
+++ b/module/web/static/js/models/Package.js
@@ -54,6 +54,16 @@ define(['jquery', 'backbone', 'underscore', 'collections/FileList', 'require'],
return Backbone.Model.prototype.destroy.call(this, options);
},
+ restart: function(options) {
+ options || (options = {});
+ var self = this;
+ options.url = 'api/restartPackage/' + this.get('pid');
+ options.success = function() {
+ self.fetch();
+ };
+ return $.ajax(options);
+ },
+
parse: function(resp) {
// Package is loaded from tree collection
if (_.has(resp, 'root')) {
@@ -75,11 +85,6 @@ define(['jquery', 'backbone', 'underscore', 'collections/FileList', 'require'],
return Backbone.model.prototype.parse.call(this, resp);
},
- // Package data is complete when it contains collection for containing files or packs
- isLoaded: function() {
- return this.has('files');
- },
-
// Any time a model attribute is set, this method is called
validate: function(attrs) {