diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-07-28 21:55:38 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-07-28 21:55:38 +0200 |
commit | 0ff3396e8853d1858db56e4ad7552f87c09e5504 (patch) | |
tree | 092d2dd53d184c5aa7488a6c23453d08c8131668 | |
parent | a57c43525786712207f8067df68045c2c33c1e04 (diff) | |
download | jquery-ui-0ff3396e8853d1858db56e4ad7552f87c09e5504.tar.gz jquery-ui-0ff3396e8853d1858db56e4ad7552f87c09e5504.zip |
Widget delegation: Small if-simplify refactoring
-rw-r--r-- | ui/jquery.ui.widget.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index d154185d5..a66b8a54a 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -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 ); } }); }, |