File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change
1
+
2
+ function basicTest ( ) {
3
+ $ ( '#magicSuggest' ) . magicSuggest ( ) ;
4
+ }
5
+
6
+ function testWithConfigurationOptions ( ) {
7
+ $ ( '#magicSuggest' ) . magicSuggest ( {
8
+ data : [
9
+ { id : 1 , name : "Buenos Aires" } ,
10
+ { id : 2 , name : "New York" } ,
11
+ { id : 3 , name : "Madrid" } ,
12
+ ] ,
13
+ maxDropHeight : 500 ,
14
+ maxSelection : 2 ,
15
+ expandOnFocus : true ,
16
+ } ) ;
17
+ }
18
+
19
+ function testSomeMethods ( ) {
20
+ var ms = $ ( '#magicSuggest' ) . magicSuggest ( ) ;
21
+ ms . addToSelection ( [ { id : 1 , name : "Mexico" } ] ) ;
22
+ console . info ( ms . getSelection ( ) ) ;
23
+ ms . disable ( )
24
+ }
Original file line number Diff line number Diff line change 5
5
6
6
/// <reference path="../jquery/jquery.d.ts" />
7
7
interface JQuery {
8
- magicSuggest : ( configurationObject : MagicSuggest . Configuration ) => MagicSuggest . Instance ;
8
+ /**
9
+ * Initialize MagicSuggest on this selector
10
+ */
11
+ magicSuggest ( configurationObject ?: MagicSuggest . Configuration ) : MagicSuggest . Instance ;
9
12
}
10
13
11
14
declare module MagicSuggest {
@@ -460,4 +463,4 @@ declare module MagicSuggest {
460
463
setDataUrlParams ( params : any ) : void ;
461
464
462
465
}
463
- }
466
+ }
You can’t perform that action at this time.
0 commit comments