~rharding/juju-gui/browser_links

« back to all changes in this revision

Viewing changes to app/views/charm-panel.js

  • Committer: Rick Harding
  • Date: 2013-04-19 12:46:02 UTC
  • mfrom: (561.1.18 add-charm-icons)
  • Revision ID: rick.harding@canonical.com-20130419124602-vz5op94gqgx4ywy3
Pull in design work, trunk, update conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
723
723
        initializer: function() {
724
724
          this.bindModelView(this.get('model'));
725
725
          this.after('heightChange', this._setScroll);
726
 
          this.after('changePanel', this._clearGhostService);
 
726
          this.on('panelRemoved', this._clearGhostService);
727
727
        },
728
728
 
729
729
        /**
748
748
 
749
749
            // Create a 'ghost' service to represent what will be deployed.
750
750
            var db = this.get('db');
 
751
            // Remove the other pending services if required.
 
752
            db.services.each(function(service) {
 
753
              if (service.get('pending')) {
 
754
                service.destroy();
 
755
              }
 
756
            });
751
757
            var serviceCount = db.services.filter(function(service) {
752
758
              return service.get('charm') === charm.get('id');
753
759
            }).length + 1;
1223
1229
      if (!Y.Lang.isValue(newPanel)) {
1224
1230
        throw 'Developer error: Unknown panel name ' + config.name;
1225
1231
      }
 
1232
      if (activePanelName) {
 
1233
        // Give to the old panel the possibility to clean things up.
 
1234
        panels[activePanelName].fire('panelRemoved');
 
1235
      }
1226
1236
      activePanelName = config.name;
1227
1237
      container.get('children').remove();
1228
1238
      container.append(panels[config.name].get('container'));
1365
1375
      container.setStyle('display', 'none');
1366
1376
      var pos = calculatePanelPosition();
1367
1377
      container.setStyle('display', 'block');
1368
 
      container.setX(pos.x);
1369
1378
      if (pos.height) {
1370
1379
        var height = pos.height - panelHeightOffset[activePanelName];
1371
1380
        container.setStyle('height', pos.height + 'px');