From d4fabd4878050fdfea4e88dfe54eb90b4e35690f Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 20 Feb 2013 17:05:30 +0100 Subject: tooltips and other improvements on webui --- module/web/static/js/models/File.js | 13 ++++++++++++- module/web/static/js/models/Package.js | 15 ++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'module/web/static/js/models') diff --git a/module/web/static/js/models/File.js b/module/web/static/js/models/File.js index 66d9ef050..efea23254 100644 --- a/module/web/static/js/models/File.js +++ b/module/web/static/js/models/File.js @@ -23,13 +23,24 @@ define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) { }, + destroy: function() { + + }, + + restart: function(options) { + options || (options = {}); + options.url = 'api/restartFile/' + this.get('fid'); + + return $.ajax(options); + }, + // Any time a model attribute is set, this method is called validate: function(attrs) { }, isDownload : function() { - return this.has('download') + return this.has('download'); } }); 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) { -- cgit v1.2.3