define(['jquery', 'backbone', 'underscore', 'models/TreeCollection', 'views/packageView', 'views/fileView'],
function($, Backbone, _, TreeCollection, packageView, fileView) {
// Renders whole PackageView
return Backbone.View.extend({
el: '#content',
events: {
'click #add': 'addPackage',
'keypress #name': 'addOnEnter',
'click #show_active': 'filter'
},
initialize: function() {
this.tree = new TreeCollection();
},
init: function() {
var self = this;
this.tree.fetch({success: function() {
self.render();
}});
},
render: function() {
var packs = this.tree.get('packages'),
files = this.tree.get('files'),
el = this.$('#dashboard');
el.empty();
el.append($('Root: ' + this.tree.get('root').get('name') + ' '));
el.append($(''));
el.append($(' Add
'));
var ul = $('