From 0ff3396e8853d1858db56e4ad7552f87c09e5504 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Thu, 28 Jul 2011 21:55:38 +0200 Subject: Widget delegation: Small if-simplify refactoring --- ui/jquery.ui.widget.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ui') 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 ); } }); }, -- cgit v1.2.3