314
314
var notification_span = Y.Node.create('<span></span>')
315
315
.addClass('sprite')
316
316
.addClass('notification-private');
317
notification_node.set('text', notification_text);
317
notification_node.set('innerHTML', notification_text);
319
318
main.appendChild(notification_node);
320
319
notification_node.appendChild(notification_span);
328
327
var body = Y.get('body');
329
328
body.addClass('feature-flag-bugs-private-notification-enabled');
330
/* Set the visible flag so that the content moves down. */
329
// Set the visible flag so that the content moves down.
331
330
body.addClass('global-notification-visible');
333
332
setup_privacy_notification();
364
* Hide privacy notifications
366
* This should be called after the page has loaded e.g. on 'domready'.
368
function hide_privacy_notification() {
369
setup_privacy_notification();
370
if (!Y.get('.global-notification').hasClass('hidden')) {
371
var fade_out = new Y.Anim({
372
node: '.global-notification',
376
var body_space = new Y.Anim({
378
to: {'paddingTop': 0},
380
easing: Y.Easing.easeOut
382
var black_link_space = new Y.Anim({
386
easing: Y.Easing.easeOut
388
fade_out.on('end', function() {
389
fade_out.get('node').addClass('hidden');
391
body_space.on('end', function() {
392
Y.get('body').removeClass('global-notification-visible');
397
black_link_space.run();
399
var privacy_portlet = Y.get('.portlet.private');
400
if (privacy_portlet !== null) {
401
var portlet_colour = new Y.Anim({
402
node: privacy_portlet,
405
backgroundColor:'#8d1f1f'
409
portlet_colour.run();
414
362
Y.on('domready', function() {
415
if (Y.get(document.body).hasClass('private')) {
363
var body = Y.get('body');
364
if (body.hasClass('private')) {
416
365
setup_privacy_notification();
417
366
display_privacy_notification();