<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I am Ad Taylor &#187; javascript</title>
	<atom:link href="http://www.iamadtaylor.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iamadtaylor.com</link>
	<description>The portfolio and blog of Ad Taylor</description>
	<lastBuildDate>Thu, 20 May 2010 22:49:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Perch Admin collapsable menu</title>
		<link>http://www.iamadtaylor.com/perch-admin-collapsable-menu/</link>
		<comments>http://www.iamadtaylor.com/perch-admin-collapsable-menu/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 09:20:22 +0000</pubDate>
		<dc:creator>Ad Taylor</dc:creator>
				<category><![CDATA[shorts]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Perch]]></category>

		<guid isPermaLink="false">http://www.iamadtaylor.com/?p=225</guid>
		<description><![CDATA[<p>My only gripe with the Perch admin interface was the landing page or more specifically the huge list of regions, I was finding that it looked daunting to new editors. This is something that Perch are looking at but I wanted a solution for the meantime. Unfortunately the solution is horribly hacky, involving altering the perch.js file.</p>]]></description>
			<content:encoded><![CDATA[<p>I <strong>promise</strong> that this will be my last post about <span class="vcard"><a href="http://www.grabaperch.com" class="url org">Perch</a></span>, I am starting to look somewhat obsessed.
</p>
<p>This hack was born out of necessity as I found that the admin <abbr title="User Interface">UI</abbr> on large <span class="vcard"><a href="http://www.grabaperch.com" class="url org">Perch</a></span> sites looked daunting to new editors.  Though the <abbr title="User Interface">UI</abbr> is beautiful and clean I was finding the lists would be endless and the editor could not find the page, let alone the region. This is something that Perch are looking at but I wanted a solution for the meantime. Unfortunately the solution is horribly hacky, involving altering the perch.js file.</p>
<h3>How to</h3>
<p>Add the following to the bottom of the perch.js file (found in the <code>your-perch-folder/assets/js/perch.js</code>)</p>
<pre name="code" class="javascript">
function pageTidy () {
	if($('td.page').length > 1) {
		resetToTidy();
		$('.page span').css({ cursor: 'pointer' });
		$('.page span').click(function() {
			resetToTidy();
			$(this).parent('td').parent('tr').addClass('currentPage');
			$('.currentPage').children('td').show();
			$('.currentPage').nextAll().each(function(index) {
				if($(this).css('display') == 'table-row'){
					return false;
				}
				$(this).show();
			});
		});
	}

}
function resetToTidy() {
	$('.d  tbody tr').hide();
	$('.shared').parent('tr').show();
	$('.shared').parent('tr').nextAll().each(function(index) {
		if($(this).children('td').hasClass('page')) {
			return false;
		}
		$(this).show();
	});
	$('.d tr').removeClass('currentPage');
	$('.page').parent('tr').show();
	$('.page').siblings('td').hide();
}
</pre>
<p>Then add <code>pageTidy();</code> to the init function. So it would now look like:</p>
<pre name="code" class="javascript">
var init	= function() {
		$('body').addClass('js');
		enhanceCSS();
		initPopups();
		hideMessages();
		pageTidy();
	};
</pre>
<h3>Warning</h3>
<p>Use at your own risk! I have found it seems to work happily on my project but I can&#8217;t imagine that it&#8217;s a good idea to be hacking away at core files. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamadtaylor.com/perch-admin-collapsable-menu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

