~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-17 02:55:39 UTC
  • mfrom: (13970.5.2 target-pickers-go)
  • Revision ID: launchpad@pqm.canonical.com-20110917025539-5bumljanv43bn801
[r=sinzui][bug=820005, 851437,
        851440] Updates the target pickers to an enhanced version similar to
        person pickers, behind a feature flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
443
443
     * @param data a json data object with the details to render
444
444
     */
445
445
    _renderTitleBadgesUI: function(data) {
 
446
        var badges = null;
446
447
        if (data.badges) {
447
 
            var badges = Y.Node.create('<div>Affiliation:</div>')
 
448
            badges = Y.Node.create('<div>Affiliation:</div>')
448
449
                .addClass('badge');
449
450
            var already_processed = [];
450
451
            Y.each(data.badges, function(badge_info) {
459
460
                    badges.appendChild(badge);
460
461
                }
461
462
            });
462
 
            return badges;
 
463
        } else if (data.target_type) {
 
464
            badges = Y.Node.create('<div></div>')
 
465
                .set('text', data.target_type)
 
466
                .addClass('badge');
463
467
        }
464
 
        return null;
 
468
        return badges
465
469
    },
466
470
 
467
471
    /**