Skip to content

Commit

Permalink
forgot to add the file!
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Médard de Chardon committed Dec 27, 2011
1 parent 4257fa4 commit fc74b35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jquery.select-to-autocomplete.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ THE SOFTWARE.
'sort': false,
'sort-attr': 'data-priority',
'sort-desc': false,
'autoselect': true,
'alternative-spellings': true,
'alternative-spellings-attr': 'data-alternative-spellings',
'remove-valueless-options': true,
Expand Down Expand Up @@ -63,6 +64,12 @@ THE SOFTWARE.
settings['handle_invalid_input'](context);
}
});
// give the input box the ability to select all text on mouse click
if ( context.settings['autoselect'] ) {
$text_field.click( function() {
this.select();
});
}
return $text_field.val( context.$select_field.find('option:selected:first').text() )
.insertAfter( context.$select_field );
},
Expand Down

0 comments on commit fc74b35

Please sign in to comment.