File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 10
10
< script type ="text/javascript " src ="../../ui/jquery.ui.button.js "> </ script >
11
11
< script type ="text/javascript " src ="../../ui/jquery.ui.position.js "> </ script >
12
12
< script type ="text/javascript " src ="../../ui/jquery.ui.autocomplete.js "> </ script >
13
+ < script type ="text/javascript " src ="../../ui/jquery.ui.tooltip.js "> </ script >
13
14
< link type ="text/css " href ="../demos.css " rel ="stylesheet " />
14
15
< style type ="text/css ">
15
16
/* TODO shouldn't be necessary */
41
42
delay : 0 ,
42
43
change : function ( event , ui ) {
43
44
if ( ! ui . item ) {
44
- // remove invalid value, as it didn't match anything
45
- $ ( this ) . val ( "" ) ;
45
+ var value = this . value ;
46
+ // remove invalid value, as it didn't match anything, and display a hint
47
+ $ ( this ) . val ( "" ) . attr ( "title" , value + " didn't match any item" ) . tooltip ( "open" ) ;
48
+ setTimeout ( function ( ) {
49
+ input . tooltip ( "close" ) . attr ( "title" , "" ) ;
50
+ } , 2500 ) ;
46
51
return false ;
47
52
}
48
53
select . val ( ui . item . id ) ;
54
59
minLength : 0
55
60
} )
56
61
. addClass ( "ui-widget ui-widget-content ui-corner-left" ) ;
57
- $ ( "<button> </button>" )
62
+ var button = $ ( "<button> </button>" )
58
63
. attr ( "tabIndex" , - 1 )
59
64
. attr ( "title" , "Show All Items" )
60
65
. insertAfter ( input )
75
80
input . autocomplete ( "search" , "" ) ;
76
81
input . focus ( ) ;
77
82
} ) ;
83
+
84
+ input . tooltip ( {
85
+ position : {
86
+ offset : ( button . width ( ) + 5 ) + " 0"
87
+ } ,
88
+ tooltipClass : "ui-state-highlight"
89
+ } ) ;
78
90
}
79
91
} ) ;
80
92
Original file line number Diff line number Diff line change 1
1
/* Tooltip
2
2
----------------------------------*/
3
3
.ui-tooltip {
4
- padding : 8px ; width : 100px ; position : absolute; z-index : 9999 ;
4
+ padding : 8px ;
5
+ width : 125px ;
6
+ position : absolute;
7
+ z-index : 9999 ;
5
8
-o-box-shadow : 0 0 5px # aaa ;
6
9
-moz-box-shadow : 0 0 5px # aaa ;
7
10
-webkit-box-shadow : 0 0 5px # aaa ;
You can’t perform that action at this time.
0 commit comments