]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget delegation: Small if-simplify refactoring 372/head
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 28 Jul 2011 19:55:38 +0000 (21:55 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 28 Jul 2011 19:55:38 +0000 (21:55 +0200)
ui/jquery.ui.widget.js

index d154185d5c6082d0614393972a7fb71a1c83592b..a66b8a54ab075925b5557c95f3697715c3e0474d 100644 (file)
@@ -322,10 +322,10 @@ $.Widget.prototype = {
                        var match = event.match( /^(\w+)\s*(.*)$/ ),
                                eventName = match[1] + "." + instance.widgetName,
                                selector = match[2];
-                       if ( selector === '' ) {
-                               element.bind( eventName, handlerProxy );
-                       } else {
+                       if ( selector ) {
                                element.delegate( selector, eventName, handlerProxy );
+                       } else {
+                               element.bind( eventName, handlerProxy );
                        }
                });
        },