~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/javascript/bugtask_index.js

[r=allenap, rvb][bug=850500] [r=allenap,
 rvb][bug=850500] Ensure the bug subscribers portlet is updated when
 the privacy/security settings change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
366
366
    qs = Y.lp.client.append_qs(qs, 'field.private', private_flag?'on':'off');
367
367
    qs = Y.lp.client.append_qs(
368
368
        qs, 'field.security_related', security_related?'on':'off');
 
369
    var sub_list_node = Y.one('#other-bug-subscribers');
 
370
    var subscribers_list = sub_list_node.getData('subscribers_loader');
369
371
    var config = {
370
372
        method: "POST",
371
373
        headers: {'Accept': 'application/xhtml'},
372
374
        data: qs,
373
375
        on: {
 
376
            start: function () {
 
377
                subscribers_list.subscribers_list.startActivity(
 
378
                    'Updating subscribers...')
 
379
            },
 
380
            end: function () {
 
381
                subscribers_list.subscribers_list.stopActivity();
 
382
            },
374
383
            success: function (id, response) {
375
384
                if (response.responseText !== '') {
376
 
                    var cache_data = Y.JSON.parse(response.responseText);
 
385
                    var result_data = Y.JSON.parse(response.responseText);
 
386
                    var subscribers = result_data.subscription_data;
 
387
                    subscribers_list._loadSubscribersFromList(subscribers);
 
388
                    var cache_data = result_data.cache_data;
377
389
                    var item;
378
390
                    for (item in cache_data) {
379
391
                        if (cache_data.hasOwnProperty(item)) {
429
441
                    }
430
442
                }
431
443
                Y.lp.client.display_notifications(
432
 
                        response.getResponseHeader('X-Lazr-Notifications'));
 
444
                    response.getResponseHeader('X-Lazr-Notifications'));
433
445
                Y.lp.anim.green_flash({node: privacy_div}).run();
434
446
            },
435
447
            failure: error_handler.getFailureHandler()