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

Unified Diff: app/views/utils.js

Issue 7417043: Add Landscape bottom-bar controls
Patch Set: Add Landscape bottom-bar controls Created 11 years, 1 month 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/unit.js ('k') | lib/views/stylesheet.less » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/views/utils.js
=== modified file 'app/views/utils.js'
--- app/views/utils.js 2013-02-11 15:58:04 +0000
+++ app/views/utils.js 2013-02-28 18:08:43 +0000
@@ -375,6 +375,39 @@
});
};
+ utils.updateLandscapeBottomBar = function(landscape, env, model, container,
+ scope) {
+ // Landscape annotations are stored in a unit's annotations, but just on
+ // the object in the case of services/environment.
+ var annotations = model.annotations ? model.annotations : model;
+ var envAnnotations = env.get ? env.get('annotations') : env;
+ var controls = container.one('.landscape-controls').hide();
+ var logo = controls.one('.logo-tab i');
+ var machine = controls.one('.machine-control').hide();
+ var updates = controls.one('.updates-control').hide();
+ var restart = controls.one('.restart-control').hide();
+
+ if (envAnnotations['landscape-url']) {
+ controls.show();
+ machine.show();
+ machine.one('a').setAttribute('href',
+ landscape.getLandscapeURL(model));
+ logo.setAttribute('class', 'sprite landscape_' + scope);
+
+ if (annotations['landscape-security-upgrades']) {
+ updates.show();
+ updates.one('a').setAttribute('href',
+ landscape.getLandscapeURL(model, 'security'));
+ }
+
+ if (annotations['landscape-needs-reboot']) {
+ restart.show();
+ restart.one('a').setAttribute('href',
+ landscape.getLandscapeURL(model, 'reboot'));
+ }
+ }
+ };
+
function _addAlertMessage(container, alertClass, message) {
var div = container.one('#message-area');
« no previous file with comments | « app/views/unit.js ('k') | lib/views/stylesheet.less » ('j') | no next file with comments »

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