From ea06e64eb4277f18b8863dac3e85b6239ea0227a Mon Sep 17 00:00:00 2001 From: nagoon97 Date: Wed, 23 Jan 2013 02:56:34 +0000 Subject: [PATCH] fixed auto scrolling bug when a new panel is opened git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12578 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/admin/tpl/js/admin.js | 23 ++++++++++++++++++++++- modules/menu/tpl/sitemap.html | 3 +-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index c2cd17e8a..510c034f1 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -1033,6 +1033,7 @@ jQuery(function($){ if(ev.keyCode === 27){ $msgBox.find("._cancel").click(); + ev.preventDefault(); } }); @@ -2426,9 +2427,29 @@ jQuery(function($){ //----------------menu selector end jQuery(function($){ + _alert = alert; + alert = function(){ return $.xeMsgBox.alert.apply($.xeMsgBox, arguments); } setTimeout(function(){$('div.message.info').fadeOut(1000);}, 2500); -}); \ No newline at end of file +}); + +jQuery(function($){ + $(document.body).on('keydown', 'input', function(ev){ + var $container, $btn; + if(ev.keyCode === 13){ + $container = $(ev.target).parent(); + while($container){ + $btn = $container.find('button.x_btn-primary'); + if($btn.length>0){ + ev.preventDefault(); + $btn.click(); + break; + } + $container = $container.parent(); + } + } + }); +}); diff --git a/modules/menu/tpl/sitemap.html b/modules/menu/tpl/sitemap.html index bbeae8ff5..bfca912dc 100644 --- a/modules/menu/tpl/sitemap.html +++ b/modules/menu/tpl/sitemap.html @@ -1386,7 +1386,7 @@ jQuery(function($){ }); function scrollToRight(){ - $('#site').scrollTo($('#site').width(), 0, {duration: 0 } ); + $('#site').scrollTo($('#site')[0].scrollWidth, 0, {duration: 0 } ); } function scrollToTop($Area){ @@ -3246,7 +3246,6 @@ jQuery(function($){ } ); }) - scrollToRight(); }); });