mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Draggable: Fixed overwriting _setOption to handle both backCompats rather than clobbering itself
This commit is contained in:
parent
e056860f5d
commit
47d2bb3094
31
ui/jquery.ui.draggable.js
vendored
31
ui/jquery.ui.draggable.js
vendored
@ -608,14 +608,22 @@ if ( $.uiBackCompat !== false ) {
|
||||
|
||||
};
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Overwriting _setOption to handle multiple backCompats
|
||||
$.widget( "ui.draggable", $.ui.draggable, {
|
||||
|
||||
_setOption: function( key, value ) {
|
||||
|
||||
if ( key !== "helper" ) {
|
||||
if ( key !== "helper" && key !== "cancel" ) {
|
||||
return this._super( key, value );
|
||||
}
|
||||
|
||||
// If part of helper backcompat
|
||||
if ( key === "helper" ) {
|
||||
|
||||
if ( value === "clone" ) {
|
||||
value = true;
|
||||
}
|
||||
@ -626,6 +634,14 @@ if ( $.uiBackCompat !== false ) {
|
||||
|
||||
this._super( key, value );
|
||||
|
||||
} else {
|
||||
|
||||
// If part of cancel backcompat
|
||||
this._super( key, value );
|
||||
this.options.exclude = this.options.cancel;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@ -673,17 +689,6 @@ if ( $.uiBackCompat !== false ) {
|
||||
this.options.exclude = this.options.cancel;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_setOption: function( key, value ) {
|
||||
|
||||
if ( key !== "cancel" ) {
|
||||
return this._super( key, value );
|
||||
}
|
||||
|
||||
this._super( key, value );
|
||||
this.options.exclude = this.options.cancel;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user