File tree Expand file tree Collapse file tree 1 file changed +25
-13
lines changed Expand file tree Collapse file tree 1 file changed +25
-13
lines changed Original file line number Diff line number Diff line change 14
14
< script src ="../../ui/jquery.ui.tooltip.js "> </ script >
15
15
< link rel ="stylesheet " href ="../demos.css ">
16
16
< style >
17
+ .ui-combobox {
18
+ position : relative;
19
+ display : inline-block;
20
+ }
17
21
.ui-button {
22
+ position : absolute;
23
+ top : 0 ;
24
+ bottom : 0 ;
18
25
margin-left : -1px ;
26
+ padding : 0 ;
27
+ /* adjust styles for IE 6/7 */
28
+ * height : 1.7em ;
29
+ * top : 0.1em ;
19
30
}
20
- .ui-button-icon-only .ui-button-text {
21
- padding : 0.35em ;
22
- }
23
31
.ui-autocomplete-input {
24
32
margin : 0 ;
25
- padding : 0.4 em 0 0.4 em 0.45 em ;
33
+ padding : 0.3 em ;
26
34
}
27
35
</ style >
28
36
< script >
29
37
( function ( $ ) {
30
38
$ . widget ( "ui.combobox" , {
31
39
_create : function ( ) {
32
- var that = this ,
40
+ var input ,
41
+ that = this ,
33
42
select = this . element . hide ( ) ,
34
43
selected = select . children ( ":selected" ) ,
35
- value = selected . val ( ) ? selected . text ( ) : "" ;
44
+ value = selected . val ( ) ? selected . text ( ) : "" ,
45
+ wrapper = $ ( "<span>" )
46
+ . addClass ( "ui-combobox" )
47
+ . insertAfter ( select ) ;
36
48
37
49
function removeIfInvalid ( element ) {
38
50
var value = $ ( element ) . val ( ) ,
59
71
}
60
72
}
61
73
62
- var input = this . input = $ ( "<input>" )
63
- . insertAfter ( select )
74
+ input = $ ( "<input>" )
75
+ . appendTo ( wrapper )
64
76
. val ( value )
65
77
. attr ( "title" , "" )
78
+ . addClass ( "ui-state-default" )
66
79
. autocomplete ( {
67
80
delay : 0 ,
68
81
minLength : 0 ,
103
116
. appendTo ( ul ) ;
104
117
} ;
105
118
106
- this . button = $ ( "<button type='button'> </button >" )
119
+ $ ( "<a >" )
107
120
. attr ( "tabIndex" , - 1 )
108
121
. attr ( "title" , "Show All Items" )
109
122
. tooltip ( )
110
- . insertAfter ( input )
123
+ . appendTo ( wrapper )
111
124
. button ( {
112
125
icons : {
113
126
primary : "ui-icon-triangle-1-s"
142
155
} ,
143
156
144
157
destroy : function ( ) {
145
- this . input . remove ( ) ;
146
- this . button . remove ( ) ;
158
+ this . wrapper . remove ( ) ;
147
159
this . element . show ( ) ;
148
160
$ . Widget . prototype . destroy . call ( this ) ;
149
161
}
159
171
</ script >
160
172
</ head >
161
173
< body >
162
-
174
+
163
175
< div class ="demo ">
164
176
165
177
< div class ="ui-widget ">
You can’t perform that action at this time.
0 commit comments