Commit 8490fc7f authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add some js for new microheader theming


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent e50989c8
......@@ -638,14 +638,22 @@ div.rbuttons .small-logo {
font-size: .9167em;
}
.viewheader .nav {
padding: 0 .5em .5em 100px;
padding: 0 .5em .5em 0;
font-size: .9167em;
border-bottom: 1px dotted #ddd;
/* border-bottom: 1px dotted #ddd; */
color: #d1d1d1;
}
.viewheader .nav a {
padding: 0 .25em;
}
.viewheader.top {
height: 1.5em;
}
.viewheader #mainnav-container {
width: 60%;
height: 1.5em;
padding: 0 .5em .5em 100px;
}
.viewheader .title {
padding: .5em 0 .25em;
font-size: 1.5em;
......
......@@ -230,3 +230,7 @@ ul.colnav li.selected a {
background: #fff;
text-decoration: none;
}
ul.colnav-extra {
display: block;
text-align: right;
}
<ul class="colnav">
{foreach from=$collection item=view name=cviews}
<li{if $view->view == $viewid} class="selected"{/if}><a href="{$WWWROOT}view/view.php?id={$view->view}">{$view->title}</a></li>
{if !$.foreach.cviews.last} {/if}
{/foreach}
{foreach from=$collection item=chunk name=cchunk}
<ul class="colnav{if !$dwoo.foreach.cchunk.first} colnav-extra js-hidden{/if}">
{foreach from=$chunk item=view}
<li{if $view->view == $viewid} class="selected"{/if}><a href="{$WWWROOT}view/view.php?id={$view->view}">{$view->title|str_shorten_text:30:true}</a></li>
{/foreach}
{if $dwoo.foreach.cchunk.first && !$dwoo.foreach.cchunk.last}
<li id="colnav-more" class="nojs-hidden"><a href=""></a></li>
{/if}
</ul>
{/foreach}
{if $dwoo.foreach.cchunk.index > 1}
<script>{literal}
addLoadEvent(function() {
connect('colnav-more', 'onclick', function(e) {
e.stop();
forEach (getElementsByTagAndClassName('ul', 'colnav-extra', null), partial(toggleElementClass, 'js-hidden'));
});
});{/literal}
</script>
{/if}
......@@ -7,8 +7,8 @@
<div id="containerX">
<div id="loading-box"></div>
<div id="top-wrapper">
<div class="viewheader rel">
<div class="links rbuttons">
<div class="viewheader top">
<div class="fr links">
{if $microheaderlinks}
{foreach from=$microheaderlinks item=item}
<a {if $item.type}class="icon btn-{$item.type}" {/if}href="{$item.url}">{$item.name}</a>
......@@ -16,11 +16,12 @@
{elseif $backurl}<a class="icon btn-reply" href="{$backurl}">{str tag=back}</a>
{/if}
</div>
<div class="lbuttons">
<div class="fl">
<a class="small-logo" href="{$WWWROOT}"><img src="{theme_url filename='images/site-logo-small.png'}" alt="{$sitename}"></a>
</div>
{if $LOGGEDIN}
<div class="nav">
<div id="mainnav-container" class="nav">
<div id="mainnav" class="js-hidden">
<a href="{$WWWROOT}user/view.php">{$USER|display_name:null:true|escape}</a> :
{foreach from=$MAINNAV item=item}
{if $item.path}
......@@ -36,7 +37,20 @@
{if $mnethost}<a href="{$mnethost.url}">{str tag=backto arg1=$mnethost.name}</a>&nbsp;{/if}
<a href="{$WWWROOT}?logout">{str tag="logout"}</a>
</div>
<script>{literal}
addLoadEvent(function(){
setStyle('mainnav', {'display': 'none'});
removeElementClass('mainnav', 'js-hidden');
connect('mainnav-container', 'onmouseenter', function(e) { appear('mainnav', {'duration': 0.25}); });
connect('mainnav-container', 'onmouseleave', function(e) { fade('mainnav', {'duration': 0.25}); });
});
{/literal}
</script>
</div>
</div>
<div class="viewheader">
{/if}
{if $collection}
<div class="left cb" id="collection"><strong>{$microheadertitle|safe}</strong> : {include file=collectionnav.tpl}</div>
{else}
......
......@@ -186,7 +186,7 @@ if ($collection = $view->get('collection')) {
if ($shownav) {
if ($views = $collection->get('views')) {
if (count($views['views']) > 1) {
$smarty->assign_by_ref('collection',$views['views']);
$smarty->assign_by_ref('collection', array_chunk($views['views'], 5));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment