Skip to content
Permalink
Browse files

Widget: Removed code for the remove event in jQuery < 1.4.

  • Loading branch information...
scottgonzalez committed Jan 14, 2011
1 parent ee77fde commit cb50642e34af69e750a5bd742f5499d7b28806a8
Showing with 7 additions and 24 deletions.
  1. +7 −24 ui/jquery.ui.widget.js
@@ -9,30 +9,13 @@
*/
(function( $, undefined ) {

// jQuery 1.4+
if ( $.cleanData ) {
var _cleanData = $.cleanData;
$.cleanData = function( elems ) {
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
$( elem ).triggerHandler( "remove" );
}
_cleanData( elems );
};
} else {
var _remove = $.fn.remove;
$.fn.remove = function( selector, keepData ) {
return this.each(function() {
if ( !keepData ) {
if ( !selector || $.filter( selector, [ this ] ).length ) {
$( "*", this ).add( [ this ] ).each(function() {
$( this ).triggerHandler( "remove" );
});
}
}
return _remove.call( $(this), selector, keepData );
});
};
}
var _cleanData = $.cleanData;
$.cleanData = function( elems ) {
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
$( elem ).triggerHandler( "remove" );
}
_cleanData( elems );
};

$.widget = function( name, base, prototype ) {
var namespace = name.split( "." )[ 0 ],

0 comments on commit cb50642

Please sign in to comment.
You can’t perform that action at this time.