Use escape key to hide popup

Bug: 62948
Change-Id: I9623cd95b5e2832d68d9409d8056ad6d50da0398
This commit is contained in:
Prateek Saxena 2014-03-23 09:53:34 +05:30
parent 17c296b187
commit 43df8474cd

View file

@ -241,6 +241,18 @@
$el $el
.off( 'mouseleave blur', leaveInactive ) .off( 'mouseleave blur', leaveInactive )
.on( 'mouseleave blur', leaveActive ); .on( 'mouseleave blur', leaveActive );
$( document ).on( 'keydown', closeOnEsc );
}
/**
* @method closeOnEsc
* Use escape to close popup
*/
function closeOnEsc( e ) {
if ( e.keyCode === 27 ) {
closeBox();
}
} }
/** /**
@ -294,6 +306,8 @@
clearTimeout( closeTimer ); clearTimeout( closeTimer );
} }
$( document ).off( 'keydown', closeOnEsc );
logEvent(); logEvent();
currentLink = closeTimer = undefined; currentLink = closeTimer = undefined;
} }