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'] |
}); |