~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/static/javascript/custom.js

  • Committer: j.c.sackett
  • Date: 2011-10-26 16:06:54 UTC
  • mto: This revision was merged to the branch mainline in revision 459.
  • Revision ID: jonathan.sackett@canonical.com-20111026160654-8gldt4sd4pzcgdk1
Some fixes; updated template to set private class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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);
318
 
 
 
317
    notification_node.set('innerHTML', notification_text);
319
318
    main.appendChild(notification_node);
320
319
    notification_node.appendChild(notification_span);
321
320
};
327
326
     is accepted. */
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');
332
331
 
333
332
    setup_privacy_notification();
360
359
    }
361
360
};
362
361
 
363
 
/*
364
 
 * Hide privacy notifications
365
 
 *
366
 
 * This should be called after the page has loaded e.g. on 'domready'.
367
 
 */
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',
373
 
            to: {opacity: 0},
374
 
            duration: 0.3
375
 
        });
376
 
        var body_space = new Y.Anim({
377
 
            node: 'body',
378
 
            to: {'paddingTop': 0},
379
 
            duration: 0.2,
380
 
            easing: Y.Easing.easeOut
381
 
        });
382
 
        var black_link_space = new Y.Anim({
383
 
            node: '.black-link',
384
 
            to: {'top': '6px'},
385
 
            duration: 0.2,
386
 
            easing: Y.Easing.easeOut
387
 
        });
388
 
        fade_out.on('end', function() {
389
 
            fade_out.get('node').addClass('hidden');
390
 
        });
391
 
        body_space.on('end', function() {
392
 
            Y.get('body').removeClass('global-notification-visible');
393
 
        });
394
 
 
395
 
        fade_out.run();
396
 
        body_space.run();
397
 
        black_link_space.run();
398
 
 
399
 
        var privacy_portlet =  Y.get('.portlet.private');
400
 
        if (privacy_portlet !== null) {
401
 
            var portlet_colour = new Y.Anim({
402
 
                node: privacy_portlet,
403
 
                to: {
404
 
                    color: '#fff',
405
 
                    backgroundColor:'#8d1f1f'
406
 
                },
407
 
                duration: 0.4
408
 
            });
409
 
            portlet_colour.run();
410
 
        }
411
 
    }
412
 
};
413
 
 
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();
418
367
    }