Updated as per markus request for viewing disk space

Added two methods to Diskprovider:-
getFixedDrives, getTotalSize
and letting UI decide on how to display space.
and changed from vent to listenTo
(cherry picked from commit 5aa00cfb6498d4731d5d880c346afe747a61024e)
This commit is contained in:
fzr600dave
2013-10-11 09:49:03 +01:00
committed by Mark McDowall
parent 041e767f3d
commit 6c414929c3
4 changed files with 35 additions and 21 deletions
+10 -12
View File
@@ -4,8 +4,9 @@ define([
'marionette',
'backgrid',
'System/DiskSpace/DiskSpaceCollection',
'Shared/LoadingView'
], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView) {
'Shared/LoadingView',
'Cells/FileSizeCell'
], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView,FileSizeCell) {
return Marionette.Layout.extend({
template: 'System/DiskSpace/DiskSpaceTemplate',
@@ -17,35 +18,32 @@ define([
{
name: 'driveLetter',
label: 'Drive',
cell: Backgrid.StringCell
cell: 'string'
},
{
name: 'freeSpace',
label: 'Free Space',
cell: Backgrid.StringCell
cell: FileSizeCell,
sortable:true
},
{
name: 'totalSpace',
label: 'Total Space',
cell: Backgrid.StringCell
cell: FileSizeCell,
sortable:true
}
],
initialize: function () {
this.collection = new DiskSpaceCollection();
this.collectionPromise = this.collection.fetch();
vent.on(vent.Events.CommandComplete, this._commandComplete, this);
this.listenTo(this.collection, 'sync', this._showTable);
},
onRender : function() {
this.grid.show(new LoadingView());
},
onShow: function() {
var self = this;
this.collectionPromise.done(function() {
self._showTable();
});
this.collection.fetch();
},
_showTable: function() {
this.grid.show(new Backgrid.Grid({