aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2011-07-28 21:55:38 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2011-07-28 21:55:38 +0200
commit0ff3396e8853d1858db56e4ad7552f87c09e5504 (patch)
tree092d2dd53d184c5aa7488a6c23453d08c8131668
parenta57c43525786712207f8067df68045c2c33c1e04 (diff)
downloadjquery-ui-0ff3396e8853d1858db56e4ad7552f87c09e5504.tar.gz
jquery-ui-0ff3396e8853d1858db56e4ad7552f87c09e5504.zip
Widget delegation: Small if-simplify refactoring
-rw-r--r--ui/jquery.ui.widget.js6
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 );
}
});
},