Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 /** | 3 /** |
4 * The view utils. | 4 * The view utils. |
5 * | 5 * |
6 * @module views | 6 * @module views |
7 * @submodule views.utils | 7 * @submodule views.utils |
8 */ | 8 */ |
9 | 9 |
10 YUI.add('juju-view-utils', function(Y) { | 10 YUI.add('juju-view-utils', function(Y) { |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
368 row.transition( | 368 row.transition( |
369 { easing: 'ease-out', duration: 3, backgroundColor: oldColor}, | 369 { easing: 'ease-out', duration: 3, backgroundColor: oldColor}, |
370 function() { | 370 function() { |
371 // Revert to following normal stylesheet rules. | 371 // Revert to following normal stylesheet rules. |
372 row.setStyle('backgroundColor', ''); | 372 row.setStyle('backgroundColor', ''); |
373 // Undo hover workaround. | 373 // Undo hover workaround. |
374 row.all('td').setStyle('backgroundColor', ''); | 374 row.all('td').setStyle('backgroundColor', ''); |
375 }); | 375 }); |
376 }; | 376 }; |
377 | 377 |
378 utils.updateLandscapeBottomBar = function(landscape, env, model, container, | 378 utils.updateLandscapeBottomBar = function(landscape, env, model, container, |
bcsaller
2013/02/28 15:21:26
Only because I used `intent` in getLandscapeURL I
matthew.scott
2013/02/28 18:16:47
Done.
| |
379 intent) { | 379 scope) { |
380 // Landscape annotations are stored in a unit's annotations, but just on | 380 // Landscape annotations are stored in a unit's annotations, but just on |
381 // the object in the case of services/environment. | 381 // the object in the case of services/environment. |
382 var annotations = model.annotations ? model.annotations : model; | 382 var annotations = model.annotations ? model.annotations : model; |
383 var envAnnotations = env.get ? env.get('annotations') : env; | 383 var envAnnotations = env.get ? env.get('annotations') : env; |
384 var controls = container.one('.landscape-controls'); | 384 var controls = container.one('.landscape-controls').hide(); |
385 var logo = controls.one('.logo-tab i'); | 385 var logo = controls.one('.logo-tab i'); |
386 var machine = controls.one('.machine-control'); | 386 var machine = controls.one('.machine-control').hide(); |
gary.poster
2013/02/28 02:16:57
trivial: maybe this should be "entity" or somethin
| |
387 var updates = controls.one('.updates-control'); | 387 var updates = controls.one('.updates-control').hide(); |
bcsaller
2013/02/28 15:21:26
Minor: If you add .hide() (its chainable) to the s
matthew.scott
2013/02/28 18:16:47
Done.
| |
388 var restart = controls.one('.restart-control'); | 388 var restart = controls.one('.restart-control').hide(); |
389 | 389 |
390 if (envAnnotations['landscape-url']) { | 390 if (envAnnotations['landscape-url']) { |
391 controls.show(); | 391 controls.show(); |
392 machine.show(); | 392 machine.show(); |
393 machine.one('a').setAttribute('href', | 393 machine.one('a').setAttribute('href', |
394 landscape.getLandscapeURL(model)); | 394 landscape.getLandscapeURL(model)); |
395 logo.setAttribute('class', 'sprite landscape_' + intent); | 395 logo.setAttribute('class', 'sprite landscape_' + scope); |
396 | 396 |
397 if (annotations['landscape-security-upgrades']) { | 397 if (annotations['landscape-security-upgrades']) { |
398 updates.show(); | 398 updates.show(); |
399 updates.one('a').setAttribute('href', | 399 updates.one('a').setAttribute('href', |
400 landscape.getLandscapeURL(model, 'security')); | 400 landscape.getLandscapeURL(model, 'security')); |
401 } else { | |
402 updates.hide(); | |
403 } | 401 } |
404 | 402 |
405 if (annotations['landscape-needs-reboot']) { | 403 if (annotations['landscape-needs-reboot']) { |
406 restart.show(); | 404 restart.show(); |
407 restart.one('a').setAttribute('href', | 405 restart.one('a').setAttribute('href', |
408 landscape.getLandscapeURL(model, 'reboot')); | 406 landscape.getLandscapeURL(model, 'reboot')); |
409 } else { | 407 } |
410 restart.hide(); | |
411 } | |
412 } else { | |
413 machine.hide(); | |
414 controls.hide(); | |
415 } | 408 } |
416 }; | 409 }; |
417 | 410 |
418 function _addAlertMessage(container, alertClass, message) { | 411 function _addAlertMessage(container, alertClass, message) { |
419 var div = container.one('#message-area'); | 412 var div = container.one('#message-area'); |
420 | 413 |
421 // If the div cannot be found (often an issue with testing), give up and | 414 // If the div cannot be found (often an issue with testing), give up and |
422 // return. | 415 // return. |
423 if (!div) { | 416 if (!div) { |
424 return; | 417 return; |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1147 }, '0.1.0', { | 1140 }, '0.1.0', { |
1148 requires: ['base-build', | 1141 requires: ['base-build', |
1149 'handlebars', | 1142 'handlebars', |
1150 'node', | 1143 'node', |
1151 'view', | 1144 'view', |
1152 'panel', | 1145 'panel', |
1153 'json-stringify', | 1146 'json-stringify', |
1154 'gallery-markdown', | 1147 'gallery-markdown', |
1155 'datatype-date-format'] | 1148 'datatype-date-format'] |
1156 }); | 1149 }); |
LEFT | RIGHT |