Close Modal Dialogs when 'esc' is pressed

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12134 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
chschy 2012-11-06 06:57:14 +00:00
parent b46b3f9d0d
commit d9859ab0d4

View file

@ -3175,13 +3175,22 @@ exec_xml("module","procModuleAdminSetDesignInfo", params, completeTmp)
$._xeAdminVar.msgBox.fnOnCancel();
});
$msgBox.bind("show", function(){
$._xeAdminVar.msgBox.bVisible = true;
showFoggy();
$._xeAdminVar.msgBox.fnOnShow();
});
$msgBox.bind("hide", function(){
$._xeAdminVar.msgBox.bVisible = false;
hideFoggy();
$._xeAdminVar.msgBox.fnOnHide();
});
$(document.body).on('keydown', function(ev){
if(!$._xeAdminVar.msgBox.bVisible) return;
if(ev.keyCode === 27){
$msgBox.find("._cancel").click();
}
});
function msgBox(htOptions){
// sTitle, sText, fnOnOK, fnOnCancel, bSmall, bAlert, fnOnShow, fnOnHide
htOptions = htOptions || {};