~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-06-02 22:22:29 UTC
  • mfrom: (13146.1.9 picker-suggestion-menu-0)
  • Revision ID: launchpad@pqm.canonical.com-20110602222229-40ti4w3zvw7nwcw7
[r=jcsackett][bug=97266] Use standard events with the picker
        suggestion widget. Fix broken picker widget and
        test_title_ellipsisification YUI test

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
  <metal:form-picker define-macro="form-picker">
7
7
    <tal:input replace="structure view/inputField" />
8
8
 
9
 
    <tal:search_results condition="not: view/hasValidInput">
10
 
      <select tal:condition="view/matches">
 
9
    <tal:search_results condition="not: view/hasValidInput"
 
10
      define="suggestion_id string:${view/name}-suggestions">
 
11
      <select tal:condition="view/matches"
 
12
        tal:attributes="id string:${suggestion_id}">
 
13
        <option value="">Did you mean...</option>
11
14
        <option
12
15
            tal:repeat="match view/matches"
13
16
            tal:attributes="value match/token;
14
 
                selected python:path('match/token') == path('view/formToken');
15
 
                onclick string:this.form['${view/name}'].value = this.value"
16
 
            tal:content="string:${match/token}: ${match/title}"
 
17
                selected python:path('match/token') == path('view/formToken');"
 
18
            tal:content="string:${match/title} (${match/token})"
17
19
            />
18
20
      </select>
 
21
      <script type="text/javascript" tal:content="string:
 
22
          LPS.use('node', 'lp.app.picker', function(Y) {
 
23
              var text_input = Y.DOM.byId('${view/name}');
 
24
              var select_menu = Y.DOM.byId('${suggestion_id}');
 
25
              Y.lp.app.picker.connect_select_menu(
 
26
                  select_menu, text_input);
 
27
          });">
 
28
      </script>
19
29
    </tal:search_results>
20
30
 
21
31
    <tal:chooseLink replace="structure view/chooseLink" />