~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/widgets/templates/form-picker-macros.pt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-22 05:56:29 UTC
  • mfrom: (13492.1.1 revert-r13485)
  • Revision ID: launchpad@pqm.canonical.com-20110722055629-0y8ss6zvhjcoo12r
[r=wgrant][rollback=13485] Revert r13485. It prevents form pickers
 from being attached to their text widgets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
            return;
36
36
        }
37
37
 
 
38
        // The vocabulary picker, created when used for the first time.
 
39
        function make_picker() {
 
40
            var config = ${view/json_config};
 
41
            if (config.picker_type == 'person') {
 
42
                config.show_assign_me_button = ${view/show_assign_me_button}
 
43
                config.show_remove_button = ${view/show_remove_button}
 
44
            }
 
45
            var picker = Y.lp.app.picker.create('${view/vocabulary_name}',
 
46
                                config,
 
47
                                '${view/input_id}');
 
48
            return picker;
 
49
        }
38
50
        var picker = null;
39
 
        var config = ${view/json_config};
40
 
        var vocabulary = config.vocabulary_name;
41
51
        Y.on('domready', function(e) {
42
52
            // Sort out the Choose... link.
43
53
            var show_widget_node = Y.one('#${view/show_widget_id}');
47
57
            show_widget_node.get('parentNode').removeClass('unseen');
48
58
            show_widget_node.on('click', function (e) {
49
59
                if (picker === null) {
50
 
                    picker = Y.lp.app.picker.create(vocabulary, config);
 
60
                    picker = make_picker();
51
61
                }
52
62
                picker.show();
53
63
                e.preventDefault();