~frankban/juju-gui/bug-1229939-service-set

« back to all changes in this revision

Viewing changes to app/views/viewlet-manager.js

  • Committer: Gary Poster
  • Date: 2013-09-24 20:34:47 UTC
  • mfrom: (1075.4.2 bug1228166)
  • Revision ID: gary.poster@canonical.com-20130924203447-4a1x436cjiecijja
Data-bind unit details view

Our unit detail view was not data-bound: it would render and never update.  This branch fixes that, except for the relation information, which is not really available at the moment (in terms of errors) so I decided that could live to fight another day.

R=jeff.pihach
CC=
https://codereview.appspot.com/13841044

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
     */
205
205
 
206
206
    /**
207
 
     Model Data access helper. By default this uses YUI Attribute styled access
208
 
     but to support property styled access you can pass an optional get
209
 
     callback such as:
210
 
 
211
 
     function(model) {return model[this.name];}
212
 
 
213
 
     This callback will be passed the model and triggered with the binding as
214
 
     'this'. `this.name` refers to the name of the model property the binding
215
 
     is managing.
216
 
 
217
 
     @property get
218
 
     @type {Function}
219
 
     @default Attribute access
220
 
     */
221
 
 
222
 
    /**
223
207
      Removes the databinding events. This method is added to the viewlet
224
208
      instance in the databinding class on binding.
225
209
 
283
267
 
284
268
    initializer: function(options) {
285
269
      // Passed in on instantiation
286
 
      this.viewletConfig = options.viewlets;
 
270
      this.viewletConfig = {};
 
271
      // Make a copy of viewlet configuration so that we never mutate the
 
272
      // original configuration.
 
273
      Y.each(options.viewlets, function(cfg, name) {
 
274
        this.viewletConfig[name] = Y.merge(cfg);
 
275
      }, this);
287
276
      this.template = options.template;
288
277
      this.templateConfig = options.templateConfig || {};
289
278
      this.viewletContainer = options.viewletContainer;