equal
deleted
inserted
replaced
238 $currentResult = getCurrentResult(); |
238 $currentResult = getCurrentResult(); |
239 |
239 |
240 if ($currentResult) { |
240 if ($currentResult) { |
241 if ( options.multiple ) { |
241 if ( options.multiple ) { |
242 if ( $input.val().indexOf(options.multipleSep) != -1 ) { |
242 if ( $input.val().indexOf(options.multipleSep) != -1 ) { |
243 $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ); |
243 $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ) + ' '; |
244 } else { |
244 } else { |
245 $currentVal = ""; |
245 $currentVal = ""; |
246 } |
246 } |
247 $input.val( $currentVal + $currentResult.text() + options.multipleSep); |
247 $input.val( $currentVal + $currentResult.text() + options.multipleSep + ' ' ); |
248 $input.focus(); |
248 $input.focus(); |
249 } else { |
249 } else { |
250 $input.val($currentResult.text()); |
250 $input.val($currentResult.text()); |
251 } |
251 } |
252 $results.hide(); |
252 $results.hide(); |
|
253 $input.trigger('change'); |
253 |
254 |
254 if (options.onSelect) |
255 if (options.onSelect) |
255 options.onSelect.apply($input[0]); |
256 options.onSelect.apply($input[0]); |
256 |
257 |
257 } |
258 } |
291 if (!source) |
292 if (!source) |
292 return; |
293 return; |
293 |
294 |
294 options = options || {}; |
295 options = options || {}; |
295 options.multiple = options.multiple || false; |
296 options.multiple = options.multiple || false; |
296 options.multipleSep = options.multipleSep || ", "; |
297 options.multipleSep = options.multipleSep || ","; |
297 options.source = source; |
298 options.source = source; |
298 options.delay = options.delay || 100; |
299 options.delay = options.delay || 100; |
299 options.resultsClass = options.resultsClass || 'ac_results'; |
300 options.resultsClass = options.resultsClass || 'ac_results'; |
300 options.selectClass = options.selectClass || 'ac_over'; |
301 options.selectClass = options.selectClass || 'ac_over'; |
301 options.matchClass = options.matchClass || 'ac_match'; |
302 options.matchClass = options.matchClass || 'ac_match'; |