]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: Removed code for the remove event in jQuery < 1.4.
authorScott González <scott.gonzalez@gmail.com>
Fri, 14 Jan 2011 00:26:52 +0000 (19:26 -0500)
committerScott González <scott.gonzalez@gmail.com>
Fri, 14 Jan 2011 00:26:52 +0000 (19:26 -0500)
ui/jquery.ui.widget.js

index b5fb600d9498adce40b81d5e985c3a4761df69ab..013d0aa6bb6281bd09acac0a9bed3b5ee732fa67 100644 (file)
@@ -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 ],