mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Widget: Bind the remove event to the element, not the .widget() element.
This commit is contained in:
parent
5f9d5c54c3
commit
eaadcc0eeb
3
ui/jquery.ui.autocomplete.js
vendored
3
ui/jquery.ui.autocomplete.js
vendored
@ -64,7 +64,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
.addClass( "ui-autocomplete-input" )
|
.addClass( "ui-autocomplete-input" )
|
||||||
.attr( "autocomplete", "off" );
|
.attr( "autocomplete", "off" );
|
||||||
|
|
||||||
this._on({
|
this._on( this.element, {
|
||||||
keydown: function( event ) {
|
keydown: function( event ) {
|
||||||
if ( this.element.prop( "readOnly" ) ) {
|
if ( this.element.prop( "readOnly" ) ) {
|
||||||
suppressKeyPress = true;
|
suppressKeyPress = true;
|
||||||
@ -191,6 +191,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
.zIndex( this.element.zIndex() + 1 )
|
.zIndex( this.element.zIndex() + 1 )
|
||||||
.hide()
|
.hide()
|
||||||
.data( "menu" );
|
.data( "menu" );
|
||||||
|
|
||||||
this._on( this.menu.element, {
|
this._on( this.menu.element, {
|
||||||
mousedown: function( event ) {
|
mousedown: function( event ) {
|
||||||
// prevent moving focus out of the text field
|
// prevent moving focus out of the text field
|
||||||
|
2
ui/jquery.ui.widget.js
vendored
2
ui/jquery.ui.widget.js
vendored
@ -237,7 +237,7 @@ $.Widget.prototype = {
|
|||||||
// TODO remove dual storage
|
// TODO remove dual storage
|
||||||
$.data( element, this.widgetName, this );
|
$.data( element, this.widgetName, this );
|
||||||
$.data( element, this.widgetFullName, this );
|
$.data( element, this.widgetFullName, this );
|
||||||
this._on({
|
this._on( this.element, {
|
||||||
remove: function( event ) {
|
remove: function( event ) {
|
||||||
if ( event.target === element ) {
|
if ( event.target === element ) {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
|
Loading…
Reference in New Issue
Block a user