Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1106)

Unified Diff: app/views/service.js

Issue 11517043: Initial pass at charm details in inspector
Patch Set: Initial pass at charm details in inspector Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/views/environment.js ('k') | app/views/view-container.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/views/service.js
=== modified file 'app/views/service.js'
--- app/views/service.js 2013-07-18 00:34:12 +0000
+++ app/views/service.js 2013-07-18 15:30:09 +0000
@@ -18,6 +18,7 @@
'use strict';
+
/**
* Provide the service views and mixins.
*
@@ -30,12 +31,12 @@
var ENTER = Y.Node.DOM_EVENTS.key.eventDef.KEY_MAP.enter;
var ESC = Y.Node.DOM_EVENTS.key.eventDef.KEY_MAP.esc;
-
var views = Y.namespace('juju.views'),
Templates = views.Templates,
models = Y.namespace('juju.models'),
plugins = Y.namespace('juju.plugins'),
- utils = Y.namespace('juju.views.utils');
+ utils = Y.namespace('juju.views.utils'),
+ viewletNS = Y.namespace('juju.viewlets');
/**
* @class manageUnitsMixin
@@ -1573,6 +1574,21 @@
} else {
units.setAttribute('checked', 'checked');
}
+ },
+
+ /**
+ Loads the charm details view for the inspector.
+
+ @method onShowCharmDetails
+ @param {Event} ev the click event from the overview viewlet.
+
+ */
+ onShowCharmDetails: function(ev) {
+ ev.halt();
+ var db = this.inspector.get('db');
+ var charmId = ev.currentTarget.getAttribute('data-charmid');
+ var charm = db.charms.getById(charmId);
+ this.inspector.showViewlet('charmDetails', charm);
}
};
@@ -1812,7 +1828,7 @@
unitIPDescription: unit_ip_description,
relations: relations
};
- this.container = Y.Node.create(this.templateWrapper());
+ this.container = Y.Node.create(this.templateWrapper({}));
this.container.one('.content').setHTML(this.template(templateData));
}
},
@@ -1985,6 +2001,9 @@
}
};
+ // Add any imported viewlets into this DEFAULT_VIEWLETS from doom.
+ DEFAULT_VIEWLETS = Y.merge(DEFAULT_VIEWLETS, viewletNS);
+
// This variable is assigned an aggregate collection of methods and
// properties provided by various controller objects in the
// ServiceInspector constructor.
@@ -2074,5 +2093,7 @@
'event-key',
'transition',
'event-resize',
- 'json-stringify']
+ 'json-stringify',
+ // Imported viewlets
+ 'viewlet-charm-details']
});
« no previous file with comments | « app/views/environment.js ('k') | app/views/view-container.js » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b