Edgewall Software
Modify

Opened 2 months ago

Closed 8 weeks ago

#13802 closed defect (fixed)

Focused item of autocomplete menu in diff view should have background color

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: version control Version: 1.4
Severity: normal Keywords:
Cc: Branch:
Release Notes:
  • Fixed background color of focused item in the autocomplete menu of diff view.
  • Fixed // entry listed wrongly in the autocomplete menu in diff view when the repository's name is configured to empty.
API Changes:
Internal Changes:

Description

Focused item of autocomplete menu in diff view has no background color.

In the above screenshot, first item is wrongly //, should be /.

Attachments (1)

autocomplete-item.png (37.4 KB ) - added by Jun Omae 2 months ago.

Download all attachments as: .zip

Change History (3)

by Jun Omae, 2 months ago

Attachment: autocomplete-item.png added

comment:1 by Jun Omae, 2 months ago

If overwriting _renderItem for autocomplete, div element should be appended to the li element.

  • trac/versioncontrol/templates/diff_form.html

    diff --git a/trac/versioncontrol/templates/diff_form.html b/trac/versioncontrol/templates/diff_form.html
    index e2209d97a..b6eedda07 100644
    a b  
    2323    ${ super() }
    2424    <script>
    2525      jQuery(function($) {
    26         $("#anydiff input[name$='_path']").autocomplete({
    27           source: window.location.pathname
    28         }).each(function() {
    29           $(this).data("ui-autocomplete")._renderItem = function(ul, item) {
    30             return $("<li>")
    31               .data("ui-autocomplete-item", item.value)
    32               .addClass(function() {
    33                 return item.isdir ? "trac-autocomplete-dir"
    34                                   : "trac-autocomplete-file";
    35               })
    36               .append(item.label)
    37               .appendTo(ul);
    38           }
    39         })
     26        var _renderItem = function(ul, item) {
     27          return $("<li>")
     28            .addClass(item.isdir ? "trac-autocomplete-dir"
     29                                 : "trac-autocomplete-file")
     30            .append($("<div>").append(item.label))  // ui-menu-item-wrapper
     31            .appendTo(ul);
     32        };
     33        $("#anydiff input[name$='_path']")
     34          .autocomplete({source: window.location.pathname})
     35          .each(function() {
     36            $(this).autocomplete("instance")._renderItem = _renderItem;
     37          });
    4038      });
    4139    </script>
    4240    # endblock head

comment:2 by Jun Omae, 8 weeks ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [17864:17865] and merged in [17866].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.