~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/javascript/distroseries.js

Add js doc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
915
915
        this.renderUI();
916
916
    },
917
917
 
 
918
    /**
 
919
     * Initialise the picket's select node.
 
920
     *
 
921
     * @method init_select
 
922
     */
918
923
    init_select: function() {
919
924
        var select = this.fieldNode.one('select');
920
925
        if (select == null) {
929
934
        return select;
930
935
    },
931
936
 
 
937
    /**
 
938
     * Add a packageset.
 
939
     *
 
940
     * @method add_choice
 
941
     */
932
942
    add_choice: function(choice) {
933
943
        var select = this.init_select();
934
944
        var option = Y.Node.create("<option />");
938
948
        select.append(option);
939
949
    },
940
950
 
 
951
    /**
 
952
     * Add choices (a set of packagesets) to the picker.
 
953
     *
 
954
     * @method add_choices
 
955
     */
941
956
    add_choices: function(packagesets, distroseries) {
942
957
        packagesets.entries.forEach(
943
958
            function(packageset) {
955
970
        Y.lazr.anim.green_flash({node: this.fieldNode}).run();
956
971
     },
957
972
 
 
973
    /**
 
974
     * Remove a distroseries: remove it's packagesets from the picker.
 
975
     *
 
976
     * @method remove_distroseries
 
977
     */
958
978
    remove_distroseries: function(distroseries_id) {
959
979
        this.fieldNode.all(
960
980
            'option[value$="\-' + distroseries_id + '"]').remove();