mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Widget: Suppress disabled check when binding destroy to the remove event. Fixes #8769 - Widget: ui-state-disabled blocks destroy to be triggered on remove.
This commit is contained in:
parent
d44557f50a
commit
1cdeeccab0
@ -1197,6 +1197,12 @@ test( "._trigger() - instance as element", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test( "auto-destroy - .remove() when disabled", function() {
|
||||||
|
shouldDestroy( true, function() {
|
||||||
|
$( "#widget" ).testWidget({ disabled: true }).remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test( "auto-destroy - .remove() on parent", function() {
|
test( "auto-destroy - .remove() on parent", function() {
|
||||||
shouldDestroy( true, function() {
|
shouldDestroy( true, function() {
|
||||||
$( "#widget" ).testWidget().parent().remove();
|
$( "#widget" ).testWidget().parent().remove();
|
||||||
|
2
ui/jquery.ui.widget.js
vendored
2
ui/jquery.ui.widget.js
vendored
@ -232,7 +232,7 @@ $.Widget.prototype = {
|
|||||||
|
|
||||||
if ( element !== this ) {
|
if ( element !== this ) {
|
||||||
$.data( element, this.widgetFullName, this );
|
$.data( element, this.widgetFullName, this );
|
||||||
this._on( this.element, {
|
this._on( true, 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