~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/javascript/client.js

  • Committer: Ian Booth
  • Date: 2011-08-30 11:07:14 UTC
  • mto: This revision was merged to the branch mainline in revision 13848.
  • Revision ID: ian.booth@canonical.com-20110830110714-nz6d772x4m1t6f6f
Add notification message when bug privacy updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
        var media_type = response.getResponseHeader('Content-Type');
328
328
        if (media_type.substring(0,16) === 'application/json') {
329
329
            representation = Y.JSON.parse(response.responseText);
330
 
            display_notifications(
 
330
            module.display_notifications(
331
331
                    response.getResponseHeader('X-Lazr-Notifications'));
332
332
            wrapped = client.wrap_resource(uri, representation);
333
333
            result = old_on_success(wrapped);
364
364
 * Display a list of notifications - error, warning, informational or debug.
365
365
 * @param notifications An json encoded array of (level, message) tuples.
366
366
 */
367
 
var display_notifications = function (notifications) {
 
367
module.display_notifications = function (notifications) {
368
368
    if (notifications === undefined) {
369
369
        return;
370
370
    }
 
371
    if (notifications === 'null' || notifications === null) {
 
372
        module.remove_notifications();
 
373
        return;
 
374
    }
371
375
 
372
376
    var notifications_by_level = {
373
377
        'level10': {