|
21 | 21 | * @type {*}
|
22 | 22 | */
|
23 | 23 | define([
|
24 |
| - "underscore", "jquery", "backbone", "view/viewutils", |
25 |
| - "text!tpl/apps/summary.html" |
26 |
| -], function (_, $, Backbone, ViewUtils, SummaryHtml) { |
| 24 | + "underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils", |
| 25 | + "text!tpl/apps/summary.html", "view/entity-config", |
| 26 | +], function (_, $, Backbone, Brooklyn, Util, ViewUtils, |
| 27 | + SummaryHtml, EntityConfigView) { |
27 | 28 |
|
28 | 29 | var EntitySummaryView = Backbone.View.extend({
|
29 | 30 | events:{
|
30 | 31 | 'click a.open-tab':'tabSelected'
|
31 | 32 | },
|
32 | 33 | template:_.template(SummaryHtml),
|
33 | 34 | initialize: function() {
|
34 |
| - _.bindAll(this) |
35 |
| - var that = this |
| 35 | + _.bindAll(this); |
| 36 | + var that = this; |
36 | 37 | this.$el.html(this.template({
|
37 | 38 | entity:this.model,
|
38 | 39 | application:this.options.application,
|
39 |
| - })) |
40 |
| - ViewUtils.attachToggler(this.$el) |
| 40 | + })); |
| 41 | + |
| 42 | + this.options.tabView.configView = new EntityConfigView({ |
| 43 | + model:this.options.model, |
| 44 | + tabView:this.options.tabView, |
| 45 | + }); |
| 46 | + this.$("div#advanced-config").html(this.options.tabView.configView.render().el); |
| 47 | + |
| 48 | + ViewUtils.attachToggler(this.$el); |
41 | 49 |
|
42 | 50 | // TODO we should have a backbone object exported from the sensors view which we can listen to here
|
43 | 51 | // (currently we just take the URL from that view) - and do the same for active tasks;
|
44 | 52 | ViewUtils.getRepeatedlyWithDelay(this, this.model.getSensorUpdateUrl(),
|
45 |
| - function(data) { that.updateWithData(data) }); |
| 53 | + function(data) { that.updateWithData(data); }); |
46 | 54 | // however if we only use external objects we must either subscribe to their errors also
|
47 | 55 | // or do our own polling against the server, so we know when to disable ourselves
|
48 | 56 | // ViewUtils.fetchRepeatedlyWithDelay(this, this.model, { period: 10*1000 })
|
49 | 57 |
|
50 | 58 | this.loadSpec();
|
51 | 59 | },
|
52 | 60 | render:function () {
|
53 |
| - return this |
| 61 | + return this; |
54 | 62 | },
|
55 | 63 | revealIfHasValue: function(sensor, $div, renderer, values) {
|
56 | 64 | var that = this;
|
|
0 commit comments