~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-19 10:19:30 UTC
  • mfrom: (13457.2.3 bug-812044)
  • Revision ID: launchpad@pqm.canonical.com-20110719101930-2c32un2txyysju59
[r=henninge][bug=812044] Wrap expander icon with a separate span to
 avoid sprite spillage. Use zero width spaces for nicer results (that work in
 webkit-based browsers) inside what were self-closing tags.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
    };
125
125
 
126
126
    var form_display = filebug_form_container.getStyle(DISPLAY);
127
 
    if (form_display != NONE) {
 
127
    if (form_display !== NONE) {
128
128
        var form_fade_out = new Y.Anim({
129
129
            node: filebug_form_container,
130
130
            to: {opacity: 0.2},
146
146
        // If the request failed due to a timeout, display a message
147
147
        // explaining how the user may be able to work around it.
148
148
        var error_message = '';
149
 
        if (response.status == 503) {
 
149
        if (response.status === 503) {
150
150
            // We treat 503 (service unavailable) as a timeout because
151
151
            // that's what timeouts in LP return.
152
152
            error_message =
333
333
 
334
334
    var product_field = Y.one(Y.DOM.byId('field.product'));
335
335
    if (Y.Lang.isValue(product_field)) {
336
 
        Y.one(Y.DOM.byId('field.actions.projectgroupsearch')).set('value', 'Next');
 
336
        Y.one(
 
337
            Y.DOM.byId('field.actions.projectgroupsearch')).set(
 
338
                'value', 'Next');
337
339
    } else {
338
340
        // Update the label on the search button so that it no longer
339
341
        // says "Continue".
363
365
    if (bug_already_reported_expanders.size() > 0) {
364
366
        // Set up the onclick handlers for the expanders.
365
367
        Y.each(Y.all('.similar-bug'), function(row) {
 
368
            var bug_expander = row.one('span.expander');
366
369
            var bug_details_div = row.one('div.duplicate-details');
367
370
            var bug_title_link = row.one('.duplicate-bug-link');
368
371
            bug_title_link.addClass('js-action');
369
372
            var view_bug_link = row.one('.view-bug-link');
370
373
            var expander = new Y.lp.app.widgets.expander.Expander(
371
 
                row, bug_details_div);
 
374
                bug_expander, bug_details_div);
372
375
            expander.setUp();
373
376
 
 
377
            // Entire row, when clicked, expands/folds bug details.
 
378
            row.on('click', function(e) {
 
379
                e.halt();
 
380
                expander.render(!expander.isExpanded());
 
381
            });
 
382
 
374
383
            // The "view this bug" link shouldn't trigger the
375
384
            // collapsible, so we stop the event from propagating.
376
385
            view_bug_link.on('click', function(e) {
406
415
                    expander.render(true);
407
416
 
408
417
                    // If the bug reporting form is shown, hide it.
409
 
                    if (bug_reporting_form.getStyle(DISPLAY) == BLOCK) {
 
418
                    if (bug_reporting_form.getStyle(DISPLAY) === BLOCK) {
410
419
                        bug_reporting_form.addClass(UNSEEN);
411
420
                    }
412
421
                }