From fc74b35c75406280207eff8afe8758cb65b86573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyrille=20M=C3=A9dard=20de=20Chardon?= Date: Tue, 27 Dec 2011 20:08:59 +0100 Subject: [PATCH] forgot to add the file! --- jquery.select-to-autocomplete.js | 7 +++++++ 1 file changed, 7 insertions(+) mode change 100644 => 100755 jquery.select-to-autocomplete.js diff --git a/jquery.select-to-autocomplete.js b/jquery.select-to-autocomplete.js old mode 100644 new mode 100755 index b9eea42..600e88e --- a/jquery.select-to-autocomplete.js +++ b/jquery.select-to-autocomplete.js @@ -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, @@ -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 ); },