~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/javascript/tests/test_picker.js

  • Committer: Curtis Hovey
  • Date: 2011-06-08 13:53:29 UTC
  • mfrom: (13176 devel)
  • mto: This revision was merged to the branch mainline in revision 13177.
  • Revision ID: curtis.hovey@canonical.com-20110608135329-5bd42r7afgzcl3lt
Merged devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
            {"value": "frieda", "title": "Frieda", "css": "sprite-person",
49
49
                "description": "frieda@example.com", "api_uri": "~/frieda"}
50
50
        ];
 
51
        this.picker = null;
51
52
        this.text_input = null;
52
53
        this.select_menu = null;
53
54
    },
59
60
        if (this.text_input !== null) {
60
61
            Y.one('body').removeChild(this.text_input);
61
62
            }
62
 
        cleanup_widget(this.picker);
 
63
        if (this.picker !== null) {
 
64
            cleanup_widget(this.picker);
 
65
            }
63
66
    },
64
67
 
65
68
    create_picker: function(validate_callback) {
197
200
        // copy the selected value to the text input field.
198
201
        this.text_input = Y.Node.create(
199
202
                '<input id="field.testfield" value="foo" />');
200
 
        node = Y.one(document.body).appendChild(this.text_input);
 
203
        var node = Y.one(document.body).appendChild(this.text_input);
201
204
        this.select_menu = Y.Node.create(
202
205
            '<select id="field.testfield-suggestions"> ' +
203
206
            '    <option value="">Did you mean...</option>' +