Keep the context area in the view if a view scrolls down several pages.

feature.content-md5
Thomas Keller 2011-06-02 02:04:52 +02:00
parent 592c2ff9ff
commit c0e26133bd
5 changed files with 25 additions and 11 deletions

View File

@ -6,6 +6,7 @@
- File download URLs now contain the file name rather than the upload id; old links still work though (issues 559 and 686)
- Display monotone file and directory attributes in the tree and file view
(needs a monotone with an interface version of 13.1 or newer)
- The context area is now kept in view when a page scrolls down several pages
## Bugfixes

View File

@ -70,7 +70,6 @@
<div id="ft">{block foot}{/block}</div>
</div>
{include 'idf/js-hotkeys.html'}
{include 'idf/list-filter.html'}
{block javascript}{/block}
{if $project}
<script type="text/javascript" charset="utf-8">{literal}

View File

@ -49,7 +49,7 @@
</div>
</div>
</div>
<div class="yui-b context">{block context}{/block}</div>
<div class="yui-b context" id="context">{block context}{/block}</div>
</div>
<div id="ft">{block foot}{/block}</div>
</div>

View File

@ -66,7 +66,7 @@
</div>
</div>
</div>
<div class="yui-b context">{block context}{/block}</div>
<div class="yui-b context" id="context">{block context}{/block}</div>
</div>
<div id="ft">{block foot}{/block}</div>
</div>
@ -84,6 +84,20 @@ $(document).ready(function(){
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
$(frag).addClass("issue-comment-focus");
}
var contextTop = $('div#context').position().top;
var contextFixEnabled = true;
$(window).scroll(function() {
if (!contextFixEnabled || $(window).scrollTop() < contextTop)
$('div#context').css('position', 'relative');
else
$('div#context').css('position', 'fixed');
});
$(window).resize(function() {
contextFixEnabled =
$('div#context').offset().top + $('div#context').height() <
$(window).height();
});
});
//]]>{/literal}
</script>{/if}

View File

@ -86,6 +86,14 @@ a.soft:visited {
div.context {
padding-left: 1em;
position: relative;
top: 0;
}
div.context h3 {
font-size: 13px;
font-weight: bold;
margin: 10px 0 5px;
}
/**
@ -928,14 +936,6 @@ ol > li {
/**
* List expander for tag and branch view
*/
.context {}
.context h3 {
font-size: 13px;
font-weight: bold;
margin: 10px 0 5px;
}
.context > .expander {
position: relative;
overflow: hidden;