dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jquery.suggestions: Only highlight prefix matches
[lhc/web/wiklou.git]
/
resources
/
src
/
jquery
/
jquery.suggestions.js
diff --git
a/resources/src/jquery/jquery.suggestions.js
b/resources/src/jquery/jquery.suggestions.js
index
884ecb6
..
8c1739c
100644
(file)
--- a/
resources/src/jquery/jquery.suggestions.js
+++ b/
resources/src/jquery/jquery.suggestions.js
@@
-353,7
+353,6
@@
$results.empty();
expWidth = -1;
for ( i = 0; i < context.config.suggestions.length; i++ ) {
$results.empty();
expWidth = -1;
for ( i = 0; i < context.config.suggestions.length; i++ ) {
- /*jshint loopfunc:true */
text = context.config.suggestions[ i ];
$result = $( '<div>' )
.addClass( 'suggestions-result' )
text = context.config.suggestions[ i ];
$result = $( '<div>' )
.addClass( 'suggestions-result' )
@@
-376,7
+375,7
@@
}
if ( context.config.highlightInput ) {
}
if ( context.config.highlightInput ) {
- $result.highlightText( context.data.prevText );
+ $result.highlightText( context.data.prevText
, { method: 'prefixHighlight' }
);
}
// Widen results box if needed (new width is only calculated here, applied later).
}
// Widen results box if needed (new width is only calculated here, applied later).
@@
-758,9
+757,9
@@
46, // delete
8 // backspace
];
46, // delete
8 // backspace
];
- if ( context.data.keypressedCount === 0
- && e.which === context.data.keypressed
-
&&
$.inArray( e.which, allowed ) !== -1
+ if ( context.data.keypressedCount === 0
&&
+ e.which === context.data.keypressed &&
+ $.inArray( e.which, allowed ) !== -1
) {
$.suggestions.keypress( e, context, context.data.keypressed );
}
) {
$.suggestions.keypress( e, context, context.data.keypressed );
}