File tree Expand file tree Collapse file tree 4 files changed +19
-9
lines changed Expand file tree Collapse file tree 4 files changed +19
-9
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 5
5
< meta http-equiv ="Content-Type " content ="text/html; charset=UTF-8 ">
6
6
7
7
< link href ="../jquery.kladr.css " rel ="stylesheet ">
8
- < link href ="css/test .css " rel ="stylesheet ">
8
+ < link href ="css/example .css " rel ="stylesheet ">
9
9
10
10
< script src ="js/jquery-1.10.2.min.js " type ="text/javascript "> </ script >
11
11
< script src ="../jquery.kladr.js " type ="text/javascript "> </ script >
12
- < script src ="js/test .js " type ="text/javascript "> </ script >
12
+ < script src ="js/example .js " type ="text/javascript "> </ script >
13
13
</ head >
14
14
< body >
15
15
< form >
File renamed without changes.
Original file line number Diff line number Diff line change 308
308
309
309
var open = function ( event ) {
310
310
// return on keyup control keys
311
- if ( event . which < 48 ) return ;
312
-
311
+ if ( ( event . which > 8 ) && ( event . which < 46 ) ) return ;
312
+
313
313
var query = key ( input . val ( ) ) ;
314
- if ( ! $ . trim ( query ) ) return ;
314
+ if ( ! $ . trim ( query ) ) {
315
+ ac . empty ( ) ;
316
+ close ( ) ;
317
+ return ;
318
+ }
315
319
316
320
spinnerShow ( ) ;
317
321
trigger ( 'send' ) ;
318
322
319
323
options . source ( query , function ( objs ) {
320
324
spinnerHide ( ) ;
321
325
trigger ( 'received' ) ;
322
- render ( objs , query ) ;
323
- position ( ) ;
324
- ac . slideDown ( 50 ) ;
325
- trigger ( 'open' ) ;
326
+
327
+ if ( ! $ . trim ( input . val ( ) ) ) {
328
+ ac . empty ( ) ;
329
+ close ( ) ;
330
+ } else {
331
+ render ( objs , query ) ;
332
+ position ( ) ;
333
+ ac . slideDown ( 50 ) ;
334
+ trigger ( 'open' ) ;
335
+ }
326
336
} ) ;
327
337
} ;
328
338
You can’t perform that action at this time.
0 commit comments