<style>
#sidebar .sub-nav-block-list .sub-nav-block{
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: none;
	position: absolute;
	background-color: #0088CC;
}
</style>
<script>
	$(window).load(function(){
		if($.support.touch) {
			mouseenterEvent = clickEvent = "touchstart";
		} else {
			clickEvent = "click";
			mouseenterEvent = "mouseenter";
		};
		var $arrowHeightFormat = $('.sub-nav-arrow').outerHeight(true)/2,$arrow = $('.sub-nav-arrow');
		var $lilist = $('.patchfile .nav-list>li');
		for(var i=0;i<$lilist.length;i++) 
			if($lilist.eq(i).find('>a').attr('href')==window.location.pathname) 
				$lilist.eq(i).addClass('active'); 
			else 
				$lilist.eq(i).removeClass('active');
		$('.sidebar-nav').children('li').off(mouseenterEvent);
		$('.patchfile_li').off(mouseenterEvent).on(mouseenterEvent, function(e) {
			$('#sidebar').addClass('on')
			$('.sub-nav-block').addClass('show');
			$arrow.stop(true, false).animate({
				top: ($(this).position().top+$(this).height()/2)-$arrowHeightFormat+$('.scroller').position().top,
			},{
				duration: 500,
				easing: 'easeInOutBack',
			});
			if(!$('.patchfile_li').hasClass('active')) {
				$('.sub-nav-block-list').css({'width': 180});
				if($('#pageslide').length) {
					if($('#pageslide').is(":hidden")) {
						$('#main-wrap').css({
							'margin-left': $('.sub-nav-block-list').width()+$('.sidebar-nav').width(),
						});
					}
				}else{
					$('#main-wrap').css({
						'margin-left': $('.sub-nav-block-list').width()+$('.sidebar-nav').width(),
					});
				}
				if($('.bottomnav').length) {
					$('.bottomnav').css({
						'left': $('.sub-nav-block-list').width()+$('.sidebar-nav').width()+20,
					});
				}
				$('#sidebar').css({
					'width': $('.sub-nav-block-list').width()+$('.sidebar-nav').width(),
				});
			}
		});
	});
</script>
<li class='patchfile_li' title="<%= (I18n.locale.to_s == 'en') ? 'Patchfile' : '抓取檔案' %>">
	<%= link_to admin_patchfiles_path, :class => active_for_action('patchfiles', 'index') do %>
		<span><i class="icons-megaphone"></i></span>
	<%end%>
</li>