Select first matching autocomplete entry for context and project form fields
One thing we lost in the recent upgrade of the jquery in tracks was it selected the first matching entry of a context or project in the form fields. As such, you have to press the down arrow key or mouse click to select one.
So I looked about and found this jquery extension:
https://github.com/scottgonzalez/jquery-ui-extensions/blob/master/autocomplete/jquery.ui.autocomplete.selectFirst.js
described here:
http://forum.jquery.com/topic/autocomplete-automatically-select-first-item-in-dropdown-or-add-item-into-drop-down-menu
So I dropped it in to my tracks and got it to work without too much trouble. I added a new js file to public/javascript and added some code to the application.js function enable_rich_interaction. I also added the new js file to the javascript_include_tag in standard.html.erb.
Maybe there is a better way, but this seems to work. Let me know if I am doing something poorly. I am not sure if tracks wants an extension that is not in the official release.
I created a branch with the commit off the current upstream master and pushed it to my github. See here: https://github.com/maddentim/tracks/commit/fdd1c8d54d167d18b88b46eb1b4ae4b134175389
So I looked about and found this jquery extension:
https://github.com/scottgonzalez/jquery-ui-extensions/blob/master/autocomplete/jquery.ui.autocomplete.selectFirst.js
described here:
http://forum.jquery.com/topic/autocomplete-automatically-select-first-item-in-dropdown-or-add-item-into-drop-down-menu
So I dropped it in to my tracks and got it to work without too much trouble. I added a new js file to public/javascript and added some code to the application.js function enable_rich_interaction. I also added the new js file to the javascript_include_tag in standard.html.erb.
Maybe there is a better way, but this seems to work. Let me know if I am doing something poorly. I am not sure if tracks wants an extension that is not in the official release.
I created a branch with the commit off the current upstream master and pushed it to my github. See here: https://github.com/maddentim/tracks/commit/fdd1c8d54d167d18b88b46eb1b4ae4b134175389
Leave a comment
on 2011-02-09 00:18 *
By lrbalt
Assigned to set to lrbalt
Status changed from New to Fixed
Assigned to set to lrbalt
Status changed from New to Fixed
(In revision:e528af30a6300db76e60e38d8970b25e106da20d) fix #1101. Thank Tim for finding the plugin. Only changed where the js was included
Branch: master
Branch: master
(In revision:f2760ed7debe60bc70687e8118ecfc86efe7a8d3) fix #1101. Most strings were pushed into html attributes. The remaining are generated from the layout into an array
Branch: master
Branch: master