From c71e91812194cd0550ebde5c9c7508a894988ec2 Mon Sep 17 00:00:00 2001 From: ChanMyeong Date: Wed, 21 Nov 2012 04:54:54 +0000 Subject: [PATCH] Install data-toggle function bugfix. git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12271 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/install/tpl/js/install.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/install/tpl/js/install.js b/modules/install/tpl/js/install.js index 6c9050f20..d593992ea 100644 --- a/modules/install/tpl/js/install.js +++ b/modules/install/tpl/js/install.js @@ -2,12 +2,17 @@ jQuery(function($){ // TARGET toggle $(document.body).on('click', '.x [data-toggle]', function(){ var $this = $(this); + if($this.is('a') && $this.attr('href') != $this.attr('data-toggle')){ + var target = $this.attr('href'); + $this.attr('data-toggle', target); + } var $target = $($this.attr('data-toggle')); + var focusable = 'a,input,button,textarea,select'; $target.toggle(); - if($target.is(':visible') && !$target.find('a,input,button,textarea,select').length){ - $target.attr('tabindex','0').focus(); - } else if($target.is(':visible') && $target.find('a,input,button,textarea,select').length) { - $target.find('a,input,button,textarea,select').eq(0).focus(); + if($target.is(':visible') && !$target.find(focusable).length){ + $target.not(':disabled').attr('tabindex','0').css('outline','0').focus(); + } else if($target.is(':visible') && $target.find(focusable).length) { + $target.not(':disabled').find(focusable).eq(0).focus(); } else { $this.focus(); }