Edgewall Software

Changes between Initial Version and Version 1 of Ticket #11084


Ignore:
Timestamp:
Feb 27, 2013, 8:51:38 AM (11 years ago)
Author:
Ryan J Ollos <ryan.j.ollos@…>
Comment:
  • In bf4c4fe4, I've tried to incorporate some of the ideas in comment:4:ticket:11056. Rather than specifying a selector by id, the element that should have focus on page load is given the trac-focus class.
    • $("selector").get(0).focus() and $("selector").focus() were both used in the Trac code base. It doesn't seem to be necessary to get the DOM object before setting focus; according to the jQuery documentation for focus, focus can operate on a jQuery object. I read some threads that seemed to suggest that the former may have been necessary earlier in the life of jQuery.
  • In 59a8df25, I moved the $("trac-focus").focus() call to layout.html. This eliminates the need to include jQuery code in several templates and reduces code duplication. This will also allow plugins to take advantage of the trac-focus class without adding any jQuery code.
  • In dbbb4fc6, the focus is set for several other admin pages and the attachment page. This is experimental; I'm less confident that these changes make sense, but seeking feedback.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11084 – Description

    initial v1  
    1414Here are some other places I'd like to see a text input or textarea have focus on page load:
    1515 * Wiki edit: ''Wiki'' textarea
     16 * Wiki rename: ''New name'' text input
    1617 * Admin !Component/Milestone/Enum/Version/Repository edit: ''Name'' text input
    1718 * Report edit: ''Title'' text input