~matsubara/juju-gui/tarmac-test

« back to all changes in this revision

Viewing changes to app/views/environment.js

  • Committer: Matthew Scott
  • Date: 2013-01-09 17:23:33 UTC
  • mfrom: (307 juju-gui)
  • mto: This revision was merged to the branch mainline in revision 312.
  • Revision ID: matthew.scott@canonical.com-20130109172333-ad6ndevmn5p44dz0
Merging with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
          //If we need the initial HTML template
36
36
          // take care of that.
37
 
          if (!this.svg) {
 
37
          if (!this._rendered) {
38
38
            EnvironmentView.superclass.render.apply(this, arguments);
39
39
            container.setHTML(Templates.overview());
40
 
            this.svg = container.one('.topology');
 
40
            this._rendered = true;
41
41
          }
42
42
 
43
43
          if (!topo) {
51
51
            // Bind all the behaviors we need as modules.
52
52
            topo.addModule(views.MegaModule);
53
53
            topo.addModule(views.PanZoomModule);
 
54
            topo.addModule(views.ViewportModule);
54
55
            topo.addModule(views.RelationModule);
55
56
 
56
57
            topo.addTarget(this);
61
62
          return this;
62
63
        },
63
64
 
64
 
        postRender: function() {
65
 
          this.topo.attachContainer();
 
65
        /**
 
66
         * Render callback handler,
 
67
         * triggered from app when the view renders.
 
68
         *
 
69
         * @method rendered
 
70
         **/
 
71
        rendered: function() {
66
72
          this.topo.fire('rendered');
67
 
          // Bind d3 events (manually)
68
 
          // this needs to be postRender and
69
 
          // the jiggle in phases has broken
70
 
          // the existing (from change to showView)
 
73
          // Bind d3 events (manually).
71
74
          this.topo.bindAllD3Events();
72
75
        }
73
76
      }, {
79
82
  requires: ['juju-templates',
80
83
             'juju-view-utils',
81
84
             'juju-models',
82
 
             'd3',
83
 
             'd3-components',
 
85
             'juju-topology',
 
86
             'svg-layouts',
84
87
             'base-build',
85
88
             'handlebars-base',
86
89
             'node',
87
 
             'svg-layouts',
88
 
             'event-resize',
89
 
             'slider',
90
90
             'view']
91
91
});