mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Autocomplete demo: Use custom namespace for combobox.
(cherry picked from commit 445ffd0acc
)
This commit is contained in:
parent
693bab1010
commit
9c2bbf4e4c
@ -14,11 +14,11 @@
|
|||||||
<script src="../../ui/jquery.ui.tooltip.js"></script>
|
<script src="../../ui/jquery.ui.tooltip.js"></script>
|
||||||
<link rel="stylesheet" href="../demos.css">
|
<link rel="stylesheet" href="../demos.css">
|
||||||
<style>
|
<style>
|
||||||
.ui-combobox {
|
.custom-combobox {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.ui-combobox-toggle {
|
.custom-combobox-toggle {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@ -28,17 +28,17 @@
|
|||||||
*height: 1.7em;
|
*height: 1.7em;
|
||||||
*top: 0.1em;
|
*top: 0.1em;
|
||||||
}
|
}
|
||||||
.ui-combobox-input {
|
.custom-combobox-input {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
(function( $ ) {
|
(function( $ ) {
|
||||||
$.widget( "ui.combobox", {
|
$.widget( "custom.combobox", {
|
||||||
_create: function() {
|
_create: function() {
|
||||||
this.wrapper = $( "<span>" )
|
this.wrapper = $( "<span>" )
|
||||||
.addClass( "ui-combobox" )
|
.addClass( "custom-combobox" )
|
||||||
.insertAfter( this.element );
|
.insertAfter( this.element );
|
||||||
|
|
||||||
this.element.hide();
|
this.element.hide();
|
||||||
@ -54,7 +54,7 @@
|
|||||||
.appendTo( this.wrapper )
|
.appendTo( this.wrapper )
|
||||||
.val( value )
|
.val( value )
|
||||||
.attr( "title", "" )
|
.attr( "title", "" )
|
||||||
.addClass( "ui-state-default ui-combobox-input ui-widget ui-widget-content ui-corner-left" )
|
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" )
|
||||||
.autocomplete({
|
.autocomplete({
|
||||||
delay: 0,
|
delay: 0,
|
||||||
minLength: 0,
|
minLength: 0,
|
||||||
@ -92,7 +92,7 @@
|
|||||||
text: false
|
text: false
|
||||||
})
|
})
|
||||||
.removeClass( "ui-corner-all" )
|
.removeClass( "ui-corner-all" )
|
||||||
.addClass( "ui-corner-right ui-combobox-toggle" )
|
.addClass( "custom-combobox-toggle ui-corner-right" )
|
||||||
.mousedown(function() {
|
.mousedown(function() {
|
||||||
wasOpen = input.autocomplete( "widget" ).is( ":visible" );
|
wasOpen = input.autocomplete( "widget" ).is( ":visible" );
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user