~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-11 22:41:38 UTC
  • mfrom: (13639.1.2 bug-823321)
  • Revision ID: launchpad@pqm.canonical.com-20110811224138-bzaw94aekw2fcfvv
[r=jcsackett][bug=823321] make the automatic suggestion search
        interact more nicely with a uesr-initiated search

Show diffs side-by-side

added added

removed removed

Lines of Context:
364
364
                privacy_link.setStyle('display', 'inline');
365
365
                lp_bug_entry = updated_entry;
366
366
 
 
367
                var notification = Y.one('.global-notification');
367
368
                if (private_flag) {
368
369
                    Y.one('body').replaceClass('public', 'private');
369
370
                    privacy_div.replaceClass('public', 'private');
371
372
                        'innerHTML',
372
373
                        'This report is <strong>private</strong> ');
373
374
                    if (privacy_notification_enabled) {
374
 
                        var notification = Y.one('.global-notification');
375
375
                        if (notification === null) {
376
376
                            Y.lp.app.privacy.setup_privacy_notification();
377
377
                        }
379
379
                    }
380
380
                } else {
381
381
                    if (privacy_notification_enabled) {
382
 
                        var notification = Y.one('.global-notification');
383
382
                        if (notification === null) {
384
383
                            Y.lp.app.privacy.setup_privacy_notification();
385
384
                        }
430
429
    lp_bug_entry.lp_save(config);
431
430
};
432
431
 
433
 
 
434
432
/**
435
433
 * Do a preemptive search for branches that contain the current bug's ID.
436
434
 */
442
440
    // A very few bugs have small IDs.
443
441
    var original_min_search_chars = picker.get('min_search_chars');
444
442
    picker.set('min_search_chars', 0);
445
 
    picker.fire('search', bug_id.toString());
 
443
    picker.fire('search', bug_id.toString(), undefined, true);
446
444
    // Don't disable the search input box or the search button while
447
445
    // doing our search.
448
446
    picker.set('search_mode', false);
494
492
        config.save = get_branch_and_link_to_bug;
495
493
        var picker = Y.lp.app.picker.create('Branch', config);
496
494
        // When the user clicks on "Link a related branch" do a search for
497
 
        // branches that contain the bug number.
498
 
        link_branch_link.subscribe('click', function (e) {
 
495
        // branches that contain the bug number (but only once).
 
496
        link_branch_link.once('click', function (e) {
499
497
            do_pre_search(picker);
500
498
        });
501
499
    }