From d9859ab0d412e22c9e0b597d2ba3188a9827e161 Mon Sep 17 00:00:00 2001 From: chschy Date: Tue, 6 Nov 2012 06:57:14 +0000 Subject: [PATCH] Close Modal Dialogs when 'esc' is pressed git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12134 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/menu/tpl/sitemap.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/menu/tpl/sitemap.html b/modules/menu/tpl/sitemap.html index ee7b02d35..9ad0f458e 100644 --- a/modules/menu/tpl/sitemap.html +++ b/modules/menu/tpl/sitemap.html @@ -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 || {};