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

Delta Between Two Patch Sets: app/views/notifications.js

Issue 9153044: sandbox event simulator
Left Patch Set: Created 11 years, 11 months ago
Right Patch Set: sandbox event simulator Created 11 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « app/views/environment.js ('k') | app/views/topology/importexport.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 'use strict'; 1 'use strict';
2 2
3 /** 3 /**
4 * Provide the notification classes. 4 * Provide the notification classes.
5 * 5 *
6 * @module views 6 * @module views
7 * @submodule views.notifications 7 * @submodule views.notifications
8 */ 8 */
9 9
10 YUI.add('juju-notifications', function(Y) { 10 YUI.add('juju-notifications', function(Y) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 * @return {undefined} Mutates only. 53 * @return {undefined} Mutates only.
54 */ 54 */
55 addNotifier: function(ev) { 55 addNotifier: function(ev) {
56 var notification = ev.model, 56 var notification = ev.model,
57 notifierBox = Y.one('#notifier-box'); 57 notifierBox = Y.one('#notifier-box');
58 // Show error notifications only if the DOM contain the notifier box. 58 // Show error notifications only if the DOM contain the notifier box.
59 if (notifierBox && 59 if (notifierBox &&
60 !notification.get('isDelta') && 60 !notification.get('isDelta') &&
61 (notification.get('level') === 'error' || 61 (notification.get('level') === 'error' ||
62 notification.get('level') === 'important')) { 62 notification.get('level') === 'important')) {
63 var msg = notification.get('message');
64 if (msg) {
65 msg = new Y.Handlebars.SafeString(msg);
66 }
63 new widgets.Notifier({ 67 new widgets.Notifier({
64 title: notification.get('title'), 68 title: notification.get('title'),
65 message: notification.get('message') 69 message: msg
66 }).render(notifierBox); 70 }).render(notifierBox);
67 } 71 }
68 }, 72 },
69 73
70 /** 74 /**
71 * Event handler for clicking the notification icon. 75 * Event handler for clicking the notification icon.
72 * 76 *
73 * @method notifyToggle 77 * @method notifyToggle
74 */ 78 */
75 notifyToggle: function(evt) { 79 notifyToggle: function(evt) {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 314
311 }, '0.1.0', { 315 }, '0.1.0', {
312 requires: [ 316 requires: [
313 'view', 317 'view',
314 'juju-view-utils', 318 'juju-view-utils',
315 'node', 319 'node',
316 'handlebars', 320 'handlebars',
317 'notifier' 321 'notifier'
318 ] 322 ]
319 }); 323 });
LEFTRIGHT

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