File tree Expand file tree Collapse file tree 4 files changed +30
-20
lines changed Expand file tree Collapse file tree 4 files changed +30
-20
lines changed Original file line number Diff line number Diff line change 9595 serviceUrl : null ,
9696 lookup : null ,
9797 onSelect : null ,
98+ onHint : null ,
9899 width : 'auto' ,
99100 minChars : 1 ,
100101 maxHeight : 300 ,
632633 that . selectedIndex = - 1 ;
633634 clearTimeout ( that . onChangeTimeout ) ;
634635 $ ( that . suggestionsContainer ) . hide ( ) ;
635- that . signalHint ( null ) ;
636+ that . onHint ( null ) ;
636637 } ,
637638
638639 suggest : function ( ) {
768769 return ! foundMatch ;
769770 } ) ;
770771
771- that . signalHint ( bestMatch ) ;
772+ that . onHint ( bestMatch ) ;
772773 } ,
773774
774- signalHint : function ( suggestion ) {
775- var hintValue = '' ,
776- that = this ;
775+ onHint : function ( suggestion ) {
776+ var that = this ,
777+ onHintCallback = that . options . onHint ,
778+ hintValue = '' ;
779+
777780 if ( suggestion ) {
778781 hintValue = that . currentValue + suggestion . value . substr ( that . currentValue . length ) ;
779782 }
780783 if ( that . hintValue !== hintValue ) {
781784 that . hintValue = hintValue ;
782785 that . hint = suggestion ;
783- ( this . options . onHint || $ . noop ) ( hintValue ) ;
784- }
786+ if ( $ . isFunction ( onHintCallback ) ) {
787+ onHintCallback . call ( that . element , hintValue ) ;
788+ }
789+ }
785790 } ,
786791
787792 verifySuggestionsFormat : function ( suggestions ) {
922927 that . el . val ( that . getValue ( that . suggestions [ index ] . value ) ) ;
923928 }
924929
925- that . signalHint ( null ) ;
930+ that . onHint ( null ) ;
926931 } ,
927932
928933 onSelect : function ( index ) {
936941 that . el . val ( that . currentValue ) ;
937942 }
938943
939- that . signalHint ( null ) ;
944+ that . onHint ( null ) ;
940945 that . suggestions = [ ] ;
941946 that . selection = suggestion ;
942947
You can’t perform that action at this time.
0 commit comments