1 DeveloperApp = new Marionette.Application();
3 DeveloperApp.addRegions({
\r
4 mainRegion: "#developerView"
\r
7 DeveloperApp.SliceDetailView = Marionette.ItemView.extend({
8 template: "#developer-slicedetail-template",
\r
10 className: 'developer_slicedetail'
\r
13 DeveloperApp.SliceListView = Marionette.CompositeView.extend({
15 className: "table table-bordered table-striped",
\r
16 template: "#developer-slicetable-template",
\r
17 childView: DeveloperApp.SliceDetailView,
\r
18 childViewContainer: "tbody",
\r
20 events: {"click .sort": "changeSort"},
\r
22 initialize: function() {
\r
23 this.listenTo(this.collection, 'change', this._renderChildren);
\r
26 changeSort: function(e) {
\r
27 parts=$(e.currentTarget).attr("id").split('-');
\r
30 console.log(fieldName);
\r
31 this.collection.sortVar = fieldName;
\r
32 this.collection.sortOrder = order;
\r
33 this.collection.sort();
\r
36 attachHtml: function(compositeView, childView, index) {
\r
37 // The REST API will let admin users see everything. For the developer
\r
38 // view we still want to hide slices we are not members of.
\r
39 if (childView.model.get("sliceInfo").roles.length == 0) {
\r
42 DeveloperApp.SliceListView.__super__.attachHtml(compositeView, childView, index);
\r
46 DeveloperApp.on("start", function() {
47 var developerSliceListView = new DeveloperApp.SliceListView({
48 collection: xos.slicesPlus
\r
50 console.log(developerSliceListView);
\r
51 DeveloperApp.mainRegion.show(developerSliceListView);
\r
52 xos.slicesPlus.startPolling();
\r
55 $(document).ready(function(){